On Nov 16, 7:59 am, Jeff Rose <[EMAIL PROTECTED]> wrote:
> Thanks for responding.  I had already seen the shebang script hack on
> the wiki, and although impressive I don't think it's a solution.  It's
> shocking to me that someone who is into lisp would even think of getting
> rid of read macros though.  For sure, there is a potential for abuse,
> but I don't think it actually happens much.  The tone set forth by the
> built-in libraries will probably have more to do than anything with
> these types of policies.  I've never experienced the pain from this, so
> maybe I'm just lucky and/or naive, but I always considered read macros
> one of the primary reasons that lisp is such a wonderful place to
> explore language ideas.
>
> Anyways, I don't want to get into a debate for now.  In the meantime how
> about defining #! to read through until the end of the line?  Hell, it
> could even be restricted to the first line of the first file.  This
> change shouldn't effect anything else, but it will make clojure programs
> as easily runnable as any other script, which should really be a must
> have for a new language on the scene.  People coming to lisp, say from
> Ruby, Python or Pearl, already have to rewire their brains a bit, and
> making them substitute this garbage:
>
>   #^:shebang '[
> exec java -cp "$HOME/src/clj/clojure/clojure.jar" clojure.lang.Script
> "$0" -- "$@"
>
> for this:
>
> #!/usr/bin/env clj
>
> makes it seem like a big hack.  For that matter, a standard clj script
> or executable should probably be a part of the package too.  How about
> it?  For the children.  Oh, and if the read table is getting modified, I
> vote for Ruby like string evaluation too :-)
>
> Cheers,
> Jeff
>
> Stephen Gilardi wrote:
> > Clojure does not currently allow programs to define new reader macros. That 
> > is unlikely to change.
>
> > There are more details here:
>
> >http://groups.google.com/group/clojure/search?group=clojure&q=reader+...
>
> > There is a clever technique described on the wiki that allows Clojure 
> > Shebang scripts:
>
> >http://en.wikibooks.org/wiki/Clojure_Programming#Shebang_Scripting_in...
>
> > (There's a link there that points to a posting that explains how it works.)
>
> > --Steve
>
> > On Saturday, November 15, 2008, at 07:52PM, "Jeff Rose" <[EMAIL PROTECTED]> 
> > wrote:
> >> Hi, I'm finding comments talking about reader macros, but nothing about
> >> defining them.  Does anyone know of an example for adding new read
> >> macros?  I'd like to define a #! macro that passes over the rest of the
> >> line so we can use clojure scripts just as easily as a ruby script would
> >> be.  If anyone knows another way to do this, that would be great too.
>

I've added #! as a to-end-of-line comment, like ;


Rich

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to