On Mon, Jan 23, 2012 at 6:23 PM, daly <d...@axiom-developer.org> wrote:
> On Mon, 2012-01-23 at 16:17 -0500, Cedric Greevey wrote:
>> On Mon, Jan 23, 2012 at 11:19 AM, daly <d...@axiom-developer.org> wrote:
>> > It accepts either noweb syntax for chunks, as in:
>> >    <<chunkname>>=
>> >      (this is lisp code)
>> >    @
>>
>> A rather unfortunate choice of delimiter if you wanted to use this
>> with Clojure code, since Clojure code frequently has internal @-signs
>> for other purposes. I don't suppose that noweb syntax was developed
>> with Clojure in mind, though, or vice-versa.
>>
>
> The noweb syntax was chosen by Norman Ramsey, the author.
> Since the tangle program processes the literate document,
> the REPL would never see the chunk syntax.

But the tangle program would, and would interpret the chunk as
stopping at the first use of @my-atom or @some-ref or @a-future...

> Instead I implemented a new latex environment called "chunk"
> so I could use \begin{chunk} as the delimiter. This means
> that the weave step is no longer required and my document
> is straight latex.

That works much better, since \end{chunk} is not valid Clojure, as
\end is not a valid character constant, and {chunk} is not a valid map
(one fewer values than keys!), so the end delimiter should never occur
accidentally inside of Clojure code. Well, there's the minor matter of
the slight chance of "\\end{chunk}" or some similar string literal, I
suppose, but it's a lot less likely than an @ character! And such a
string literal can be broken up using e.g. (str "\\en" "d{chunk}").
Though that's a bit of an ugly hack, it's only likely to arise in
exactly one instance: the Clojure code used to implement tangle
itself.

> In the HTML version I used <pre id="chunkname"> so that
> the weave step is not required either.

</pre> being the delimiter, I presume. Another one that ought to be
rare in Clojure code and absent outside of string literals, though
given the frequent use of Clojure with Compojure/etc. to emit HTML,
it'll be more common there than \end{chunk}. I suppose it might also
be a valid symbol, but you'd have to be crazy to have (defn </pre>
[foo] ...) in your code base. :)

> For Eclipse I suppose we could invent a chunk syntax
> and create a plugin. If people are interested perhaps we
> could create a Literate Clojure plugin for Eclipse. See
> http://www.eclipse.org/articles/Article-Your%20First%
> 20Plug-in/YourFirstPlugin.html
> That would make Clojure and Literate much more useful
> to Eclipse users.

Based on CCW, or a de novo effort?

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to