Re: Ok, so code is data...

2021-11-30 Thread Brent Millare
Do you want to create an html visualization in html? The main thing to check is other code walkers for reference like https://github.com/ztellman/riddley but I strongly recommend trying this out yourself without using other libraries as you will learn a lot in the process. You don't need to "c

Re: Ok, so code is data...

2021-11-29 Thread Kovas Palunas
Just stumbled across this thread 10 years later! I'm actually interested in doing the same thing: taking some clojure logic that I write and converting it to a call-graph in html. Is there any prior art here I should know about? Or can this be done with basic clojure to e.g. convert the code

Re: Ok, so code is data...

2011-05-10 Thread Bill Robertson
Thanks for the feedback and pointers. On May 10, 11:37 am, Timothy Baldridge wrote: > On Tue, May 10, 2011 at 10:26 AM, Jonathan Fischer Friberg < > > odysso...@gmail.com> wrote: > > "How do I actually just load code w/o evaluating it?" > > mostly when you want something like this, you want a m

Re: Ok, so code is data...

2011-05-10 Thread Timothy Baldridge
On Tue, May 10, 2011 at 10:26 AM, Jonathan Fischer Friberg < odysso...@gmail.com> wrote: > "How do I actually just load code w/o evaluating it?" > mostly when you want something like this, you want a macro. Manipulating > code is also done within macros. > Yeah, I would consider the whole code-i

Re: Ok, so code is data...

2011-05-10 Thread Jonathan Fischer Friberg
"How do I actually just load code w/o evaluating it?" mostly when you want something like this, you want a macro. Manipulating code is also done within macros. http://www.gigamonkeys.com/book/macros-standard-control-constructs.html http://www.gigamonkeys.com/book/macros-defining-your-own.html Jon

Aw: Ok, so code is data...

2011-05-10 Thread Stefan Kamphausen
Hi, from what you write I get the feeling, that you may be doing things in a too complicated manner. Maybe I am wrong. In any case, although it may not be Clojure but Common Lisp, you might want to take a look at the HTML generation in Peter Seibels excellent Practical Common Lisp: See chapte

Re: Ok, so code is data...

2011-05-10 Thread Bill Robertson
Thank you very much. On May 10, 1:32 am, Justin Kramer wrote: > 'read' and 'read-string' are what you're looking for. They each read a > single Clojure object from an input source (PushbackReader for read, > String for read-string). > > Alternatively, something like this can read all top-level fo

Re: Ok, so code is data...

2011-05-09 Thread Justin Kramer
'read' and 'read-string' are what you're looking for. They each read a single Clojure object from an input source (PushbackReader for read, String for read-string). Alternatively, something like this can read all top-level forms from a file: (defn read-all "Reads all top-level forms from f, whi

Ok, so code is data...

2011-05-09 Thread Bill Robertson
How do I actually manipulate it? I have some complicated logic that I would like to transform into html (or maybe xml) for display purposes. I'm generating the Clojure code by parsing some nasty Java and outputting s-expressions. The Java is basic, but quite deeply nested. I want to generate wo