amazed to see there are people who find myObject.myMethod(x, y, z); easier to read than (my-function x y z) - that's 2 delimiters in Clojure vs 6 in your C-style language
myobject.(mymethod x y.w z.bar)
Notations can be useful. Most Lispers reach for 'expr rather than (quote expr). Rational numbers could look like #R(1 2) but CL has 1/2 instead.I decided on a dot notation for object access because OOP is used to organize the program as a whole; so it's not some small thing like arithmetic.
The dot notation integrates into Lisp; it doesn't disturb the syntax with ambiguities and reads/prints cleanly, and corresponds to structure in several straightforward ways:
a.b.c -> (qref a b c)
.a.b.c -> (uref a b c)
There must not be whitespace: a . b is the consing dot, which can only appear at the end of the list. Of course, if a and b are 3 and 2, we get 3.2 which is a floating-point token; and that mustn't be glued to something else. 1> '(qref a b c)
a.b.c
2> '(qref a b (qref c))
(qref a b (qref c))
3> '(qref a (qref b c))
(qref a b.c)
4> 3.2.a
expr-4:1: trailing junk in floating-point literal: 3.2.a
** syntax error
5> '(qref a (b c) d (e) (f g))
a.(b c).d.(e).(f g)
There are qref and uref macros which do useful things with the notation. E.g. 14> (stat "args.h")
#S(stat dev 2049 ino 670288 mode 33204 nlink 1 uid 500 gid 500 rdev 0
size 5628 blksize 4096 blocks 16 atime 1540848391 mtime 1524635813
ctime 1524635813 path "args.h")
15> (mapcar [chain stat [juxt .path .size]] (glob "*.h"))
(("args.h" 5628) ("arith.h" 2270) ("buf.h" 3712) ("cadr.h" 2515)
("combi.h" 1517) ("config.h" 2644) ("debug.h" 3762) ("dict.h" 4373)
("eval.h" 3898) ("ffi.h" 5146) ("filter.h" 2298) ("ftw.h" 1492)
("gc.h" 2370) ("glob.h" 1485) ("hash.h" 3412) ("itypes.h" 3238)
("lib.h" 37442) ("lisplib.h" 1680) ("match.h" 2031) ("parser.h" 4597)
("rand.h" 1798) ("regex.h" 3204) ("signal.h" 7954) ("socket.h" 1460)
("stream.h" 8553) ("struct.h" 3475) ("strudel.h" 1486) ("sysif.h" 2747)
("syslog.h" 1998) ("termios.h" 1436) ("txr.h" 1885) ("unwind.h" 9880)
("utf8.h" 2590) ("vm.h" 1681) ("vmop-ORIG.h" 1660) ("vmop.h" 2008)
("y.tab.h" 4542))
Example OOP code that is full of the notation is found in the compiler: http://www.kylheku.com/cgit/txr/tree/share/txr/stdlib/compil...I feel I have come up with a successful design: a way of integrating the dot selection notation into a Lisp dialect without losing "Lispiness".