zlacker

[parent] [thread] 5 comments
1. mr_luc+(OP)[view] [source] 2007-07-06 22:46:30
Stupid questions alert. ____________________________

In On Lisp, you mentioned that implementing continuations with closures via transformation to CPS could be accomplished by writing a code walker, but that this would be a "serious undertaking" in Common Lisp.

This struck me at the time and ever since as painful, but understandable. Macros aren't first-class objects in CL, so the code you're walking through could be very complex due to macro-expansion, and I could be wrong, but I don't remember if the resulting code would necessarily contain clues that tell us what macro generated it, etc.

Could one assume (and it is definitely an assumption, or speculation, not a deduction from what you've given us here!) that it would be much simpler in Arc? Say, a page or so of code?

replies(2): >>mr_luc+1 >>pg+4
2. mr_luc+1[view] [source] 2007-07-06 22:48:27
>>mr_luc+(OP)
Hmmm. I guess I could also ask "What does readall do?" and go on speculating to myself, but the stuff above is what I really want to know. Once I've defined something (macro, function), what does it look like in Arc? Is its structure, either before or after macroexpansion, available to play cute little tricks with?

I'll stop asking questions now. I feel I'm reaching the limits even of assumption and might start getting silly. (For instance: "Could I write a function that let me select nodes within a loaded function using CSS Selector syntax?", but that's just silly so I won't ask it).

replies(1): >>pg+5
3. pg+4[view] [source] 2007-07-06 22:57:29
>>mr_luc+(OP)
I could make it as easy as I wanted to write a codewalker, by changing the language where necessary. But it's not a priority right now. I haven't been doing anything where I felt I needed a codewalker.
◧◩
4. pg+5[view] [source] [discussion] 2007-07-06 22:58:43
>>mr_luc+1
readall keeps calling read till it runs out of input, and returns a list of all the results.
replies(1): >>mr_luc+7
◧◩◪
5. mr_luc+7[view] [source] [discussion] 2007-07-06 23:22:35
>>pg+5
That's what I asked for, all right.

Sorry for asking obtuse questions obtusely. Let me try this way:

How much would codetree need to change to accept a function or macro as input instead of a file, and produce output that is similarly meaningful? (Not at all, a little bit, a lot).

Sorry again for poor question quality, and to harp on what increasingly appears to be an unimportant point.

replies(1): >>pg+I2
◧◩◪◨
6. pg+I2[view] [source] [discussion] 2007-07-08 01:12:43
>>mr_luc+7
I assume by taking a fn as input you mean taking a fn whose return values would become the input. That would not be hard, but the clean way to do it would be to modify read so that it could take a fn as an argument.
[go to top]