fix bug in repeated function calls

This commit is contained in:
Aidan 2020-07-08 21:09:24 -07:00
parent 93cd5c5a48
commit 81d299aa5e
No known key found for this signature in database
GPG key ID: 327711E983899316
3 changed files with 20 additions and 11 deletions

View file

@ -48,6 +48,18 @@ func (t *Token) Append(arg *Token) {
}
}
/* Shallow Copy
* in case of a LIST,
* inner will point to the same list.
*/
func (t *Token) Copy() *Token {
return &Token{
Tag: t.Tag,
inner: t.inner,
Next: t.Next,
}
}
/* Print function which is better suited for repl.
* This one prints the SEXPRs as one would write them.
* Does not evaluate tokens.