gcl-devel
[Top][All Lists]
Advanced

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

[Gcl-devel] Re: possible lisp reader enhancement/modification


From: Camm Maguire
Subject: [Gcl-devel] Re: possible lisp reader enhancement/modification
Date: 08 Jul 2003 12:52:30 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!  Given Paul's analysis, let's put in this feature.  You
might want to try this patch:

diff -u -r1.14 read.d
--- read.d      26 Feb 2003 22:21:37 -0000      1.14
+++ read.d      8 Jul 2003 16:47:32 -0000
@@ -392,6 +392,9 @@
        Read_object(in) reads an object from stream in.
        This routine corresponds to COMMON Lisp function READ.
 */
+
+static object p0=Cnil;
+
 object
 read_object(in)
 object in;
@@ -587,6 +590,15 @@
                token->st.st_fillp = length - (colon + 2);
        } else
                p = current_package();
+       if (c->ch.ch_code=='(' && !token->st.st_fillp && colon_type) {
+         p0=p;
+         x=read_object(in);
+         p0=Cnil;
+         vs_reset;
+         return (x);
+       }
+       if (p0!=Cnil)
+         p=p0;
        vs_push(p);
        x = intern(token, p);
        vs_push(x);


=============================================================================
(sid)address@hidden:/fix/t1/camm/gcl/unixport$ ./saved_gcl
GCL (GNU Common Lisp)  (2.5.3) Tue Jul  8 15:22:09 UTC 2003
Licensed under GNU Library General Public License
Dedicated to the memory of W. Schelter

Use (help) to get some basic information on how to use GCL.

>(quote lisp::(a b c))

(LISP::A LISP::B LISP::C)

>(quote (a b c))

(A B C)

>(by)
=============================================================================

I'll test this and commit to the unstable branch if all is well.
Comments welcome, as always.

Take care,

Matt Kaufmann <address@hidden> writes:

> Thanks for the quick reply!
> 
> -- Matt
>    cc: address@hidden, "Paul F. Dietz" <address@hidden>
>    From: Camm Maguire <address@hidden>
>    Date: 02 Jul 2003 15:42:16 -0400
>    User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
>    Content-Type: text/plain; charset=us-ascii
> 
>    Greetings, and thanks for your suggestion!
> 
>    I'm forwarding this to the list to solicit opinions from our ANSI
>    standard experts on whether such a change would be permissible in ANSI
>    common lisp.  Comments?
> 
>    Take care,
> 
>    Matt Kaufmann <address@hidden> writes:
> 
>    > Hi --
>    > 
>    > I wonder if it would be possible to modify the GCL reader so that package
>    > prefixes can apply to lists, not just symbols.  Here's an example of 
> what I
>    > mean.
>    > 
>    >   >'lisp::(a b)
>    > 
>    >   LISP::||
>    > 
>    >   >
>    >   Error: The function A is undefined.
>    >   Fast links are on: do (si::use-fast-links nil) for debugging
>    >   Error signalled by EVAL.
>    >   Broken at EVAL.  Type :H for Help.
>    >   >>
>    > 
>    > Here is the corresponding log for Allegro Common Lisp.
>    > 
>    >   CL-USER(2): 'lisp::(a b)
>    >   (COMMON-LISP::A COMMON-LISP::B)
>    >   CL-USER(3): 
>    > 
>    > I'm pretty sure that there's no CLtL requirement to make such a change.  
> It's
>    > even possible that GCL does this right and Allegro CL does it wrong.  But
>    > anyhow, I thought I'd ask, because it would be very handy to have such a
>    > capability in GCL (it could affect which Lisp is used under ACL2 at AMD).
>    > 
>    > Thanks --
>    > -- Matt
>    > 
>    > 
>    > 
> 
>    -- 
>    Camm Maguire                                               address@hidden
>    ==========================================================================
>    "The earth is but one country, and mankind its citizens."  --  Baha'u'llah
> 
> 
> 

-- 
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]