forked from alex-eg/sex
say that a binder is a copy, and where %-> is
A match binder looks like a reference to its field and is not one. And with `.' reading an untyped receiver as a value, nothing said how to write the arrow by hand.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
(ops expr
|
||||
(pub fn eval ((self (* const expr))) float
|
||||
;; v, e, l and r are copies of the fields, not references to them
|
||||
(match (* self)
|
||||
((lit (v)) (return v))
|
||||
((neg (e)) (return (- (.eval e))))
|
||||
|
||||
Reference in New Issue
Block a user