Skip to content

Commit

Permalink
!296 improve stack%push in (liii stack)
Browse files Browse the repository at this point in the history
  • Loading branch information
TREE37 authored and da-liii committed Mar 6, 2025
1 parent 3f32523 commit 6dadca4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
7 changes: 2 additions & 5 deletions goldfish/liii/stack.scm
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,8 @@
(stack (set! data (cdr data))))
(%this))

(define (%push element . es)
(let1 r (stack (cons element data))
(if (null? es)
r
(apply r es))))
(chained-define (%push element)
(stack (cons element data)))

(chained-define (%push! element)
(stack (set! data (cons element data)))
Expand Down
10 changes: 2 additions & 8 deletions liii_stack.tmu
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,9 @@
<paragraph|stack%push>

<\scm-chunk|goldfish/liii/stack.scm|true|true>
(define (%push element . es)\
(chained-define (%push element)

\ \ (let1 r (stack (cons element data))

\ \ \ \ (if (null? es)

\ \ \ \ \ \ \ \ r

\ \ \ \ \ \ \ \ (apply r es))))
\ \ (stack (cons element data)))

\;
</scm-chunk>
Expand Down

0 comments on commit 6dadca4

Please # to comment.