[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bitwise logical operators

   Date: Tue, 16 Jun 92 18:31:25 +0200
   From: tmb@idiap.ch  (Thomas M. Breuel)

   Why not simply divide the standard into a "language" and into
   a "library" section. In fact, most non-essential features could
   go into the library section, as well as some essential procedures
   with library character (is "map" essential?).

One thing that is important here is to let the user have some idea of
what is available in an implementation.  If more things become
optional it becomes difficult to write real programs portably.  I have
tried in SLIB to group procedures into logical categories and have a
mechanism for letting the user inquire about the existence of these
features.  I offered DEFINED? as one way to solve this, but it doesn't
seem popular.  Here is what is currently in SLIB for feature support.
*modules* is availble to prevent user files from being loaded more
than once.


  *features*						variable

Is a list of symbols denoting features supported in this

  *modules*						variable

Is a list of pathnames denoting files which have been loaded.

  *catalog*						variable

Is an association list of features (symbols) and pathnames which will
supply those features.

In the following three functions if <feature> is not a symbol it is
assumed to be a pathname.

  (provided? <feature>)					procedure

Returns #t if <feature> is a member of *features* or *modules* or if
<feature> is supported by a file already loaded and #f otherwise.

  (require <feature>)					procedure

If (not (provided? <feature>)) it is loaded if <feature> is a pathname
or if (assq <feature> *catalog*).  Otherwise an error is signaled.

  (provide <feature>)					procedure

Assures that <feature> is contained in *features* if <feature> is a
symbol and *modules* otherwise.

The current pallet of features is

	rev4-report			;conforms to
	rev3-report			;conforms to
	ieee-p1178			;conforms to
	sicp				;runs code from Structure and
					;Interpretation of Computer
					;Programs by Abelson and Sussman.
	delay				;has delay and force
	i/o-redirection			;with-input-from-file
	char-ready?			;has
	transcript			;transcript-on and transcript-off
	macro				;has r4rs high level macros
	eval				;slib:eval is single argument eval.
	record				;has user defined data structures
	values				;proposed multiple values
	ieee-floating-point		;conforms to
	full-continuation		;can return multiple times

	sort				;sort and merge
	queue				;queues
	compiler			;has compile
	ed				;(ed) is editor
	system				;posix (system <string>)
	getenv				;posix (getenv <string>)
	tmpnam				;posix (tmpnam)
	program-arguments		;returns list of strings (argv)
	Xwindows			;X support
	curses				;screen management package
	termcap				;terminal description package
	terminfo			;sysV terminal description

The current list of portable features (for whom code is available) is

rev4-optional-procedures, rev3-procedures, rev2-procedures,
multiarg/and-, multiarg-apply, rationalize, alist, hash, hash-table,
logical, random, random-inexact, modular, prime, charplot, sort,
common-list-functions, format, generic-write, pretty-print,
pprint-file, pretty-print-to-string, object->string, stdio, debug,
eval, record, promise, synchk, sc-macro, macro, oop, values, queue,
priority-queue, process, test.