guile-devel
[Top][All Lists]
Advanced

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

Re: Scheme-defined smobs


From: Paul Jarc
Subject: Re: Scheme-defined smobs
Date: Mon, 03 Nov 2003 19:16:42 -0500
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

Rob Browning <address@hidden> wrote:
> address@hidden (Paul Jarc) writes:
>> ... which shows me the output of "ls -a".  So I can use Guile as a
>> shell with a bit less typing.
>
> Wow, that's really scary.

Quite.  I do not claim that this was a good way to reach this goal.
It was just fun to do, and I can imagine that it might be genuinely
useful for other things, mostly for the user-defined equal?-ness.

Side note: my make-smob-type subr returns an applicable instance of a
statically-defined smob, because I didn't know how to create a lambda
in C, except in the top-level environment.  Is there a way to do it
that would follow scope rules as if the lambda appeared in the
surrounding Scheme code?  I suppose it shouldn't need to look up
anything in surrounding local scopes anyway, though.

>   (let ((next (read)))
>     (if (special-value? next)
>         (lookup-and-do-special-thing-for next)
>         (print (eval next (current-module)))))

That would certainly be cleaner.  What would probably be more useful,
though, is some kind of read syntax, so I could say "ls -a", with the
space, and have it all read as one line, and constructed into the
appropriate Scheme code.  Then, of course, I'd want to have some way
to pre-seed the readline buffer with the read-syntax prefix, so I
wouldn't have to type it manually. :)


paul




reply via email to

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