12345678910111213141516171819202122232425 |
- // dotsymbols: no longer special
- // (def) on a dot-symbol is illegal
- (def a 9)
- //(def .a 3)
- (assert (== .a %.a))
- (assert (== a 9))
- //
- // nested paths of dot-symbols work
- //
- (def s (snoopy asst: (hornet sidekick: (hellcat fname:"henry" lname:"johnson"))))
- // get
- (assert (== s.asst.sidekick.fname "henry"))
- // assign
- {s.asst.sidekick.lname = "smith"}
- (assert (== s.asst.sidekick.lname "smith"))
- // without leading .
- (def h (hash a:10))
- (assert (== h.a 10))
|