23 |
* Evaluator trap options:: |
* Evaluator trap options:: |
24 |
* Examples of option use:: |
* Examples of option use:: |
25 |
* Install Config:: Installation and configuration data. |
* Install Config:: Installation and configuration data. |
26 |
|
* Feature Tracking:: Available features in the Guile process. |
27 |
@end menu |
@end menu |
28 |
|
|
29 |
@node General option interface |
@node General option interface |
403 |
modules and libraries. |
modules and libraries. |
404 |
@end defvar |
@end defvar |
405 |
|
|
406 |
|
@defvar %guile-build-info |
407 |
|
Alist of information collected during the building of a particular |
408 |
|
@code{guile} program. Entries can be grouped into one of several |
409 |
|
categories: directories, env vars, and versioning info. |
410 |
|
|
411 |
|
Briefly, here are the keys in @code{%guile-build-info}, by group: |
412 |
|
@itemize @bullet |
413 |
|
@item directories |
414 |
|
srcdir, top_srcdir, prefix, exec_prefix, bindir, sbindir, libexecdir, |
415 |
|
datadir, sysconfdir, sharedstatedir, localstatedir, libdir, infodir, |
416 |
|
mandir, includedir, pkgdatadir, pkglibdir, pkgincludedir |
417 |
|
@item env vars |
418 |
|
LIBS |
419 |
|
@item versioning info |
420 |
|
guileversion, libguileinterface, buildstamp |
421 |
|
@end itemize |
422 |
|
|
423 |
|
Values are all strings. The value for @code{LIBS} is typically found also as |
424 |
|
a part of "guile-config link" output. The value for @code{guileversion} has |
425 |
|
form X.Y.Z, and should be the same as returned by @code{version}. The value |
426 |
|
for @code{libguileinterface} is libtool compatible and has form |
427 |
|
CURRENT:REVISION:AGE. The value for @code{buildstamp} is the output of the |
428 |
|
date(1) command. |
429 |
|
|
430 |
|
In the source, @code{%guile-build-info} is initialized from |
431 |
|
libguile/libpath.h, which is completely generated, so deleting this file |
432 |
|
before a build guarantees up-to-date values for that build. |
433 |
|
@end defvar |
434 |
|
|
435 |
|
|
436 |
|
@node Feature Tracking |
437 |
|
@section Feature Tracking |
438 |
|
|
439 |
|
Guile has a Scheme level variable @code{*features*} that keeps track to |
440 |
|
some extent of the features that are available in a running Guile. |
441 |
|
@code{*features*} is a list of symbols, for example @code{threads}, each |
442 |
|
of which describes a feature of the running Guile process. |
443 |
|
|
444 |
|
@defvar *features* |
445 |
|
A list of symbols describing available features of the Guile process. |
446 |
|
@end defvar |
447 |
|
|
448 |
|
You shouldn't modify the @code{*features*} variable directly using |
449 |
|
@code{set!}. Instead, see the procedures that are provided for this |
450 |
|
purpose in the following subsection. |
451 |
|
|
452 |
|
@menu |
453 |
|
* Feature Manipulation:: Checking for and advertising features. |
454 |
|
* Common Feature Symbols:: Commonly available features. |
455 |
|
@end menu |
456 |
|
|
457 |
|
|
458 |
|
@node Feature Manipulation |
459 |
|
@subsection Feature Manipulation |
460 |
|
|
461 |
|
To check whether a particular feature is available, use the |
462 |
|
@code{provided?} procedure: |
463 |
|
|
464 |
|
@deffn {Scheme Procedure} provided? feature |
465 |
|
@deffnx {Deprecated Scheme Procedure} feature? feature |
466 |
|
Return @code{#t} if the specified @var{feature} is available, otherwise |
467 |
|
@code{#f}. |
468 |
|
@end deffn |
469 |
|
|
470 |
|
To advertise a feature from your own Scheme code, you can use the |
471 |
|
@code{provide} procedure: |
472 |
|
|
473 |
|
@deffn {Scheme Procedure} provide feature |
474 |
|
Add @var{feature} to the list of available features in this Guile |
475 |
|
process. |
476 |
|
@end deffn |
477 |
|
|
478 |
|
For C code, the equivalent function takes its feature name as a |
479 |
|
@code{char *} argument for convenience: |
480 |
|
|
481 |
|
@deftypefn {C Function} void scm_add_feature (const char *str) |
482 |
|
Add a symbol with name @var{str} to the list of available features in |
483 |
|
this Guile process. |
484 |
|
@end deftypefn |
485 |
|
|
486 |
|
|
487 |
|
@node Common Feature Symbols |
488 |
|
@subsection Common Feature Symbols |
489 |
|
|
490 |
|
In general, a particular feature may be available for one of two |
491 |
|
reasons. Either because the Guile library was configured and compiled |
492 |
|
with that feature enabled --- i.e. the feature is built into the library |
493 |
|
on your system. Or because some C or Scheme code that was dynamically |
494 |
|
loaded by Guile has added that feature to the list. |
495 |
|
|
496 |
|
In the first category, here are the features that the current version of |
497 |
|
Guile may define (depending on how it is built), and what they mean. |
498 |
|
|
499 |
|
@table @code |
500 |
|
@item array |
501 |
|
Indicates support for arrays (@pxref{Arrays}). |
502 |
|
|
503 |
|
@item array-for-each |
504 |
|
Indicates availability of @code{array-for-each} and other array mapping |
505 |
|
procedures (@pxref{Array Mapping}). |
506 |
|
|
507 |
|
@item char-ready? |
508 |
|
Indicates that the @code{char-ready?} function is available |
509 |
|
(@pxref{Reading}). |
510 |
|
|
511 |
|
@item complex |
512 |
|
Indicates support for complex numbers. |
513 |
|
|
514 |
|
@item current-time |
515 |
|
Indicates availability of time-related functions: @code{times}, |
516 |
|
@code{get-internal-run-time} and so on (@pxref{Time}). |
517 |
|
|
518 |
|
@item debug-extensions |
519 |
|
Indicates that the debugging evaluator is available, together with the |
520 |
|
options for controlling it. |
521 |
|
|
522 |
|
@item delay |
523 |
|
Indicates support for promises (@pxref{Delayed Evaluation}). |
524 |
|
|
525 |
|
@item EIDs |
526 |
|
Indicates that the @code{geteuid} and @code{getegid} really return |
527 |
|
effective user and group IDs (@pxref{Processes}). |
528 |
|
|
529 |
|
@item inexact |
530 |
|
Indicates support for inexact numbers. |
531 |
|
|
532 |
|
@item i/o-extensions |
533 |
|
Indicates availability of the following extended I/O procedures: |
534 |
|
@code{ftell}, @code{redirect-port}, @code{dup->fdes}, @code{dup2}, |
535 |
|
@code{fileno}, @code{isatty?}, @code{fdopen}, |
536 |
|
@code{primitive-move->fdes} and @code{fdes->ports} (@pxref{Ports and |
537 |
|
File Descriptors}). |
538 |
|
|
539 |
|
@item net-db |
540 |
|
Indicates availability of network database functions: |
541 |
|
@code{scm_gethost}, @code{scm_getnet}, @code{scm_getproto}, |
542 |
|
@code{scm_getserv}, @code{scm_sethost}, @code{scm_setnet}, @code{scm_setproto}, |
543 |
|
@code{scm_setserv}, and their `byXXX' variants (@pxref{Network |
544 |
|
Databases}). |
545 |
|
|
546 |
|
@item posix |
547 |
|
Indicates support for POSIX functions: @code{pipe}, @code{getgroups}, |
548 |
|
@code{kill}, @code{execl} and so on (@pxref{POSIX}). |
549 |
|
|
550 |
|
@item random |
551 |
|
Indicates availability of random number generation functions: |
552 |
|
@code{random}, @code{copy-random-state}, @code{random-uniform} and so on |
553 |
|
(@pxref{Random}). |
554 |
|
|
555 |
|
@item reckless |
556 |
|
Indicates that Guile was built with important checks omitted --- you |
557 |
|
should never see this! |
558 |
|
|
559 |
|
@item regex |
560 |
|
Indicates support for POSIX regular expressions using |
561 |
|
@code{make-regexp}, @code{regexp-exec} and friends (@pxref{Regexp |
562 |
|
Functions}). |
563 |
|
|
564 |
|
@item socket |
565 |
|
Indicates availability of socket-related functions: @code{socket}, |
566 |
|
@code{bind}, @code{connect} and so on (@pxref{Network Sockets and |
567 |
|
Communication}). |
568 |
|
|
569 |
|
@item sort |
570 |
|
Indicates availability of sorting and merging functions |
571 |
|
(@pxref{Sorting}). |
572 |
|
|
573 |
|
@item system |
574 |
|
Indicates that the @code{system} function is available |
575 |
|
(@pxref{Processes}). |
576 |
|
|
577 |
|
@item threads |
578 |
|
Indicates support for multithreading (@pxref{Threads}). |
579 |
|
|
580 |
|
@item values |
581 |
|
Indicates support for multiple return values using @code{values} and |
582 |
|
@code{call-with-values} (@pxref{Multiple Values}). |
583 |
|
@end table |
584 |
|
|
585 |
|
Available features in the second category depend, by definition, on what |
586 |
|
additional code your Guile process has loaded in. The following table |
587 |
|
lists features that you might encounter for this reason. |
588 |
|
|
589 |
|
@table @code |
590 |
|
@item defmacro |
591 |
|
Indicates that the @code{defmacro} macro is available (@pxref{Macros}). |
592 |
|
|
593 |
|
@item describe |
594 |
|
Indicates that the @code{(oop goops describe)} module has been loaded, |
595 |
|
which provides a procedure for describing the contents of GOOPS |
596 |
|
instances. |
597 |
|
|
598 |
|
@item readline |
599 |
|
Indicates that Guile has loaded in Readline support, for command line |
600 |
|
editing (@pxref{Readline Support}). |
601 |
|
|
602 |
|
@item record |
603 |
|
Indicates support for record definition using @code{make-record-type} |
604 |
|
and friends (@pxref{Records}). |
605 |
|
@end table |
606 |
|
|
607 |
|
Although these tables may seem exhaustive, it is probably unwise in |
608 |
|
practice to rely on them, as the correspondences between feature symbols |
609 |
|
and available procedures/behaviour are not strictly defined. If you are |
610 |
|
writing code that needs to check for the existence of some procedure, it |
611 |
|
is probably safer to do so directly using the @code{defined?} procedure |
612 |
|
than to test for the corresponding feature using @code{feature?}. |
613 |
|
|
614 |
|
|
615 |
@c Local Variables: |
@c Local Variables: |
616 |
@c TeX-master: "guile.texi" |
@c TeX-master: "guile.texi" |