This commit is contained in:
Nathan Braswell
2020-05-12 21:30:37 -04:00
parent bf53d3701f
commit 722a72579a
5 changed files with 183 additions and 328 deletions

View File

@@ -8,7 +8,7 @@
(println "no method " method)
(apply method_fn object arguments)))))
; method call syntax
(add_grammer_rule 'form [ 'form "\\." 'atom 'optional_WS "\\(" 'optional_WS 'space_forms 'optional_WS "\\)" ] (fn* (o _ m _ _ _ p _ _) `(method-call ~o '~m ,p)))
(add_grammar_rule 'form [ 'form "\\." 'atom 'optional_WS "\\(" 'optional_WS 'space_forms 'optional_WS "\\)" ] (fn* (o _ m _ _ _ p _ _) `(method-call ~o '~m ,p)))
(def! actual_obj (with-meta [0] [
'inc (fn* (o) (set-nth! o 0 (+ (nth o 0) 1)))
'dec (fn* (o) (set-nth! o 0 (- (nth o 0) 1)))