4 ms·
The Lisp expression is a nice sideways tree, where we immediately see that three conditions are joined by and. When I look at it, I see this: and --.-- no
by kazinator 8y ago
The Lisp expression is a nice sideways tree, where we immediately see that three conditions are joined by and. When I look at it, I see this:
and --.-- not (is-blocked door)
:-- < (height player) (height door)
`-- or --.---(is-unlocked door)
`--(has-key player door)
The other one looks like a bit of a lorem ipsum paragraph to me.
- rspeele 8y agoI guess it comes down to different strokes for different folks. It would be interesting if there was a website that quizzed you on randomly generated expressions like these, giving you S-expr forms sometimes and ALGOL/infix operator forms other times, and asking you whether the expression is true or false given a set of variable values. Naively I would guess that I would do best on infix exprs and you would do best on s-exprs. But I could imagine other results, like s-exprs giving me a speed disadvantage but an accuracy advantage (either because I had to read them more carefully or because they eliminate reliance on precedence rules). Or there may be other quirks, like maybe S-exprs read better for larger, multiline conditions while infix reads better on short one-liners with <= 3 operations. It reeks of effort so I'm not going to make such a site, but I do wonder what the results would be.