Arc Forumnew | comments | leaders | submitlogin
1 point by akkartik 5064 days ago | link | parent

"(Keep in mind that this version still doesn't quote 'f and 'g, which I recommend doing in case they're lists or something.)"

You mean for something like:

  (compose '(1 2 3) *)

?


1 point by rocketnia 5063 days ago | link

Yep. Here's a slightly-less-toy toy example:

  (let (foo nil bar nil)
    ; ...build foo and bar up as lists...
    ; ...
    (foo:- len.bar 1)
    ; ...
    )
If 'compose creates (<value of foo> (<value of -> len.bar 1)), then <value of foo>, being a list, might evaluate as an fexpr call.

-----

1 point by akkartik 5063 days ago | link

In wart fexprs either evaluate to a compiled op or to a list with the atom evald-lambda in the car.

You do raise the question of dealing with lists and hashes in function position. Wart doesn't do that yet, and it wasn't even on my todo list so far.

-----

1 point by rocketnia 5063 days ago | link

"You do raise the question of dealing with lists and hashes in function position. Wart doesn't do that yet, and it wasn't even on my todo list so far."

Oh, if you choose not to add that, I don't mind. ^_^

Still, as long as there's no quoting, I'm betting people can inject code in there, like (compose '$args '(while t)). Not that it's wrong to design 'compose with that code-injection feature in mind, but it would surprise me.

-----