mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
parent
88506ca53e
commit
c4c3cb9eb9
2 changed files with 17 additions and 1 deletions
|
@ -16,7 +16,7 @@
|
|||
((%cut #t (params ...) (args ...) x . rest)
|
||||
(let ((tmp x)) (%cut #t (params ...) (args ... tmp) . rest)))
|
||||
((%cut #f (params ...) (args ...) x . rest)
|
||||
(%cut #t (params ...) (args ... x) . rest))))
|
||||
(%cut #f (params ...) (args ... x) . rest))))
|
||||
(define-syntax cut
|
||||
(syntax-rules () ((cut args ...) (%cut #f () () args ...))))
|
||||
(define-syntax cute
|
||||
|
|
16
tests/srfi-26-tests.scm
Normal file
16
tests/srfi-26-tests.scm
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
(import (scheme base) (srfi 26) (chibi test))
|
||||
|
||||
(test-begin "srfi-26")
|
||||
|
||||
(let ((x 'orig))
|
||||
(let ((f (cute list x)))
|
||||
(set! x 'wrong)
|
||||
(test '(orig) (f))))
|
||||
|
||||
(let ((x 'wrong))
|
||||
(let ((f (cut list x)))
|
||||
(set! x 'right)
|
||||
(test '(right) (f))))
|
||||
|
||||
(test-end)
|
Loading…
Add table
Reference in a new issue