Lisp HUG Maillist Archive

What is #.(enable-meta-syntax)?

I'm trying to compile langutils, which is basically only supported on  
Allegro (boo hiss). I've fixed a couple of things while trying to asdf  
it into the system, but I think it's dying on this line:

#.(enable-meta-syntax)

Does anyone know what this is, exactly? I'm getting the following error:

**++++ Error in (TOP-LEVEL-FORM 19):
  Object #<Function META::META-READER 215608B2> is of type FUNCTION  
which is not externalizable to #<STREAM::LATIN-1-FILE-STREAM /Users/ 
paladin/dev/lisp/packages/langutils-1.0/langutils/src/t_tokenize.xfasl>.

Or am I wrong in thinking this is the problem? Anyone?

Cheers,
John H. Doe (my real name)


Re: What is #.(enable-meta-syntax)?

Hi John,

I'm not very familiar with langutils but I have seen the error you are  
getting before. A similar error will occur in Lispworks if you try  
something like

(defun foo (x y &key (fun #'identity))
	(eq x (funcall fun y)))

The issue is that you have named a function (#'identity) and told the  
compiler to write it out to the fasl. In general, the compiler can't  
do this because functions are not "externalizable" (I don't recall  
when the spec says this but it is there somewhere...). The work around  
in this silly example is to _name_ the function rather than specifying  
it directly. E.g.,

(defun foo (x y &key (fun 'identity))
	(eq x (funcall fun y)))

I tried to get the meta stuff working in a similar fashion but didn't  
have any luck. A better strategy may be to pull out anything that  
needs to have a different readtable and compile/load those separately  
using a special asdf component type. I can try this eventually but  
probably not for a week or two. Let me know.

On May 1, 2008, at 6:24 AM, John H. Doe wrote:
>
> I'm trying to compile langutils, which is basically only supported  
> on Allegro (boo hiss). I've fixed a couple of things while trying to  
> asdf it into the system, but I think it's dying on this line:
>
> #.(enable-meta-syntax)
>
> Does anyone know what this is, exactly? I'm getting the following  
> error:
>
> **++++ Error in (TOP-LEVEL-FORM 19):
> Object #<Function META::META-READER 215608B2> is of type FUNCTION  
> which is not externalizable to #<STREAM::LATIN-1-FILE-STREAM /Users/ 
> paladin/dev/lisp/packages/langutils-1.0/langutils/src/ 
> t_tokenize.xfasl>.
>
> Or am I wrong in thinking this is the problem? Anyone?
>
> Cheers,
> John H. Doe (my real name)
>

--
Gary Warren King, metabang.com
Cell: (413) 559 8738
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM





Re: What is #.(enable-meta-syntax)?

On Thu, May 1, 2008 at 10:48 PM, John H. Doe <one@nyll.com> wrote:
BTW, I found (enable-meta-syntax):

(defun enable-meta-syntax ()
       (copy-readtable *meta-readtable* *readtable*))

Though I still don't understand what the #. does.

The prefix #. states that the evaluation of the form must happen at read time. The return value is to be externalized (included as a literal object in the fasl file):
 http://www.lisp.org/HyperSpec/Body/sec_2-4-8-6.html

I have not looked at the code, but maybe the following solves the problem: replace
 #.(enable-meta-syntax)
by
 #.(progn (enable-meta-syntax) nil)

The return value of the form is to be externalized, which in the first case is the copied or updated readtable (perhaps not externalizable), and in the second case the value nil which is certainly externalizable. If the side effect of copying the read table is the only thing that matters (which seems to be the case if the #.(enable-meta-syntax) form is not part of another form), the latter form should work equally well.

- Willem
Updated at: 2020-12-10 08:43 UTC