I don't think I'll use the toplevel-command stuff after all: I can't promise that the toplevel symbols readline exports won't get overwritten, and I'm not entirely sure readline has any business providing private toplevel symbols that are only applicable to it. It might confuse less-experienced users*, for one, and for another there's the already mentioned possibility of symbol collision, unless somebody more knowledge on this subject can prove otherwise.

* In the sense that they may not realize that it's part of readline and so may expect it's behavior to remain consistent even when readline is not in use.

On 01/27/2015 01:36 AM, Peter Bex wrote:
On Tue, Jan 27, 2015 at 09:10:31AM +0100, Shawn Rutledge wrote:
On 26 January 2015 at 00:02, Matt Welland <[email protected]> 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
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to