joshibharathiramana
2020-11-5 17:11:08

Does and evaluate all its arguments? Or is the short circuting such that it not only saves unnecessary boolean checks after encountering a #f , but also saves evaling arguments that occur after a #f?


joshibharathiramana
2020-11-5 17:12:13

since Racket is strict, I’m expecting the former and am curious


samth
2020-11-5 17:18:44

and is short-circuiting


samth
2020-11-5 17:19:05

try out (and #f (display 'hi))


sorawee
2020-11-5 17:21:32

strictness has to do with function application


sorawee
2020-11-5 17:21:49

In Racket, and is not a function. It’s a syntax


sorawee
2020-11-5 17:22:24

Just like most other languages like C, Python, JS, etc.


joshibharathiramana
2020-11-5 17:22:25

oh that makes sense then, I was thinking it was a function


joshibharathiramana
2020-11-5 17:35:40

what is a good way to guess what is a function and what is part of syntax? (other than go read the grammar :sweat_smile:). I thought and was a function since its usage was very similar to function application



soegaard2
2020-11-5 20:28:34

Also, you can enter and in the repl. If it is a function, you will get <procedure>, if it is a syntactic form (in most cases), you will get an error.


sorawee
2020-11-5 20:33:27

this is not foolproof though. Identifier macro exists, though rare.


joshibharathiramana
2020-11-6 02:11:27

@sorawee can you give an example?