3 ms·
It seems like the infix issue would be a pretty simple modification to eval: if the first thing isn’t callable, try the second thing. But I’ve never seen this
by cellularmitosis 5y ago
It seems like the infix issue would be a pretty simple modification to eval: if the first thing isn’t callable, try the second thing. But I’ve never seen this done, so it must be more complicated than I realize.
- GavinMcG 5y agoThe problem is that the first thing might be callable, and it might expect one or more arguments that could include functions. If your intention was to add something to the result of a function, but + was passed as input to that function, you wouldn't get what you expected.
- cellularmitosis 5y agoSure, if the first thing is callable, you always go with the default eval strategy, like in this case: (map - (quote (1 2 3))) I'm only talking about cases where the first thing isn't callable, but the second thing is: (3 + 1) It seems like this couldn't ever be a problem, because the only cases in which the infix strategy would be used are cases which would have been invalid programs anyway. Does that make sense?