On Tue, Jan 27, 2015 at 09:10:31AM +0100, Shawn Rutledge wrote:
On 26 January 2015 at 00:02, Matt Welland <address@hidden> wrote:
From http://wiki.call-cc.org/man/4/Using%20the%20interpreter the
,commands are called "toplevel commands" and you can define them with:
(toplevel-command SYMBOL PROC [HELPSTRING])
Where does this tradition come from? Is it related somehow to the use of
the comma as unquote inside a quasiquote?
I suppose so: at the toplevel, you can enter any _expression_, so for
example just entering X will evaluate it. For that reason you'll
need a special character to indicate that you're talking to the
interpreter itself instead of evaluating something at the toplevel.
You can't unquote anything outside a quasiquote _expression_, so it's
kind of natural to use that as a prefix: it's one of the few undefined
characters to use without adding additional restrictions to the lexical
syntax of symbols, for example.
It always seems unintuitive to
me to start anything with a comma.
I've gotten used to it already, but then I'd used vi for such a long time
that starting a command with a colon seems "intuitive" to me also :)
Cheers,
Peter
_______________________________________________
Chicken-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/chicken-users