26 ms·
Could ^a be dispensed with? It looks like (a) is equivalent to it.
by tonyg 2y ago
Could ^a be dispensed with? It looks like (a) is equivalent to it.
- dugmartin 2y agoI think the equivalent would be ('a) instead as (a) would resolve to "'result of application of a' push".
- tonyg 2y agoThe page says that "`(foo bar) force` is the same computation as `foo bar`" and that "`^a force` is the same computation as `a`". So then `(a) force` should be the same computation as `^a force`.
- xorvoid 2y agoSubtly different. Originally I didn’t have ^a, but you do in-fact need it. ^a means “push with no evaluation” and (a) means “build a closure” that computes a”. If you push, pop, push, pop, push repeatedly you’ll be wrapping the value in lots of closures. The value is no longer a value too. You’d have to “force” it to get back the value. Semantically quite different. If you’re going all Turing tarpit, could you survive without “^a”? Maybe. But you’d be suffering for sure.
- tonyg 2y agoOperationally, you don't have to do the wrapping: since (a) is equivalent to ^a, you can substitute the implementation of the latter when you see the former. Though if `(a)` is observably "no longer a value" of course then that's an issue. Which may or may not be a problem :-)
- xorvoid 2y agoI thought of that. But then you’re making the semantics complicated. Say you really did want a (a) closure. Now you can’t have one, and you have to resort to more tricky wrapping. Not worth it.