Opened 10 years ago

Last modified 10 years ago

#662 new enhancement

Export and possibly enhance CCL::DEFINE-TOPLEVEL-COMMAND

Reported by: tfb Owned by:
Priority: trivial Milestone:
Component: other Version: trunk
Keywords: Cc:


I think it would be useful if DEFINE-TOPLEVEL-COMMAND was exported from CCL, as it would be nice if users could rely on it existing.

Additionally, I think it would be good if it could be enhanced to allow "evalquote-like" commands which would not evaluate their arguments. This second part is probably much harder than the first (and might want to be another ticket).

Change History (2)

comment:1 Changed 10 years ago by gz

FWIW, I've wished for non-evaluating commands as well, so I can add a :gui command to evaluate stuff in the gui thread.

comment:2 Changed 10 years ago by tfb

I have spent a little time looking at how to do the second part, and it requires some reworking of the toplevel loop, but I think it is possible. My suggestion would be to extend the syntax of DEFINE-TOPLEVEL-COMMAND to allow something like this:

(define-toplevel-command :global (gui :eval nil) (...) ...)

This avoids breaking existing uses (no extra arguments, and no existing use can have a cons for the command name) and also would provide room for future expansion - it might be nice to have commands which just get handed the raw input stream for instance, of which get handed their arguments as strings or something like that.

Note: See TracTickets for help on using tickets.