Opened 9 years ago

Closed 9 years ago

#823 closed enhancement (wontfix)

Shebang support

Reported by: mcandre Owned by:
Priority: normal Milestone:
Component: other Version: trunk
Keywords: Cc:


I like to start my Common Lisp scripts with #!/usr/bin/env ccl. But when I load them in the CCL interpreter, I get an error:

Undefined character #\! in a #\# dispatch macro.

Could CCL include shebangs as ordinary CL syntax? CLISP and SBCL do.

Change History (2)

comment:1 Changed 9 years ago by gb

If you wanted to extend CL syntax so that #! and the rest of the line it's on was ignored by the lisp reader, how would you do so ?

Note that according to table 2-19 in section 2.4.8 of CLHS, the implementation isn't allowed to say:

(set-dispatch-macro-character #\# #\!
  (lambda (stream char n)
    (declare (ignore char n))
    (do* ((ch (read-char stream nil nil) (read-char stream nil nil)))
         ((or (null ch) (eql ch #\newline)) (values)))))

but the user is (e.g., in their init file.)

That's probably good enough in many ways. I'm not sure that doing this at a deeper level is all that desirable, precisely because #! really isn't "ordinary CL syntax"; it may be a reasonable guess that a #! at the beginning of standard input means that standard input is coming from a shell script that uses #!, but it's ultimately just a guess.

comment:2 Changed 9 years ago by rme

  • Component changed from IDE to other
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.