4 ms·
Logo lets you leave out parentheses most of the time, except to use rest arguments or force grouping. For example: ? print list sum 0 1 2 1 2 That exp
by kbp 9y ago
Logo lets you leave out parentheses most of the time, except to use rest arguments or force grouping. For example:
? print list sum 0 1 2
1 2
That expression parses as (print (list (sum 0 1) 2)) because both list and sum normally take 2 arguments. However, using the parenthesised function call syntax, you can pass them however many you like:
? (print (list 1 2 3 (sum 1 1 1 1)))
1 2 3 4
Or you can of course mix and match (probably to better effect than this example):
? print (list 1 2 sum 1 2 4)
1 2 3 4
Logo also lets you use infix arithmetic operators with normal precedence:
? print 1 + 2 * 3 + 4
11
- breck 9y agoI love Logo! Advanced Logo by Michael Friendly is one of my programming books. Logo came very close to TN and ETNs but adding the parens and other visible syntax I believe was a design mistake. It's not obvious, but when working with large programs in 2 and 3 dimensions (only possible with parens free lisp, or ETNs as we call them), you gain tremendous productivity benefits