Skip to content

Commit

Permalink
redefine define to return the original value
Browse files Browse the repository at this point in the history
  • Loading branch information
devyn committed Aug 10, 2023
1 parent 7dcc83e commit db03f50
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion stage2/00-early.lsp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; (define <key> <value>)
; (define <key> <value>) = ?
(call-native define$
(ref (quote define))
(ref (proc args scope
Expand Down Expand Up @@ -42,6 +42,14 @@
(eval scope (car args))
(eval scope (cadr args))))))

; redefine define to return the original value
(define define (proc args scope
(seq1
(call-native define$
(ref (car args))
(ref (eval scope (cadr args))))
(eval scope (car args)))))

; (print <object>) = <object>
(define print (proc args scope
(deref (car
Expand Down

0 comments on commit db03f50

Please sign in to comment.