[Top][All Lists]

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

[Gcl-devel] Re: defconstant vs. defparameter

From: Camm Maguire
Subject: [Gcl-devel] Re: defconstant vs. defparameter
Date: 12 Dec 2005 22:07:58 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Robert Boyer <address@hidden> writes:

> > The problem has always been that we have two array types, static and
> > normal, which have the same print/read representation, so it is impossible
> > to pass a static array by this method.
> If we are going to have non-ANSI-standard objects around, like static arrays,
> we might as well have nonstandard ways to read them in, too.  Parodying the
> way that AMD and Intel enhance their x86 instruction sets to 64-bits, we
> might simply have a new instruction in the READ process that toggles the
> (new) default value that :static takes in make-array from t to nil and back.
> That way, you don't have to invent or worry about a really new syntax for
> these other kinds of arrays.  Simply put something like:
>    #.(setq si::*make-array-static-by-default* (not 
> si::*make-array-static-by-default*)) #(1 2 3)

This is an absolutely fantastic idea!  To imlement, though, we would
need to take the mods you propose below to make-array and apply to
Lsharp_left_parenthesis_reader, as the latter does not call the former.
Is this easier and/or cleaner than just defining some #% reader or
some such?  We already have #!, #u, and #v for special GCL features.
Perhaps this is confusing and unfriendly to the user.

take care,

> into the read stream, after changing
> (defun make-array (dimensions
>                  &key (element-type t)
>                       (initial-element nil)
>                       (initial-contents nil initial-contents-supplied-p)
>                       adjustable fill-pointer
>                       displaced-to (displaced-index-offset 0)
> =>                    (static si::*make-arrays-static-by-default*)))
> and adding
> (defvar si::*make-arrays-static-by-default* nil)
> Bob
> P. S.  Or even
>    #.(let ((si::*make-array-static-by-default* t))
>      #(1 2 3))

Camm Maguire                                            address@hidden
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]