mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 03:30:27 +02:00
s/match-lambda\*/case-lambda/g
* module/system/il/macros.scm: Use case-lambda from srfi-16 rather than match-lambda*.
This commit is contained in:
parent
67169b2960
commit
3164d8d0f3
1 changed files with 8 additions and 8 deletions
|
@ -20,7 +20,7 @@
|
|||
;;; Code:
|
||||
|
||||
(define-module (system il macros)
|
||||
:use-module (ice-9 match))
|
||||
:use-module (srfi srfi-16))
|
||||
|
||||
(define (make-label) (gensym ":L"))
|
||||
(define (make-sym) (gensym "_"))
|
||||
|
@ -34,7 +34,7 @@
|
|||
;;
|
||||
;; (@if X (@and Y...) #f)
|
||||
(define @and
|
||||
(match-lambda*
|
||||
(case-lambda
|
||||
(() #t)
|
||||
((x) x)
|
||||
((x . rest) `(@if ,x (@and ,@rest) #f))))
|
||||
|
@ -43,7 +43,7 @@
|
|||
;;
|
||||
;; (@let ((@_ X)) (@if @_ @_ (@or Y...)))
|
||||
(define @or
|
||||
(match-lambda*
|
||||
(case-lambda
|
||||
(() #f)
|
||||
((x) x)
|
||||
((x . rest)
|
||||
|
@ -86,27 +86,27 @@
|
|||
;(define (@>= x y) `(@@ ge? ,x ,y))
|
||||
|
||||
(define @+
|
||||
(match-lambda*
|
||||
(case-lambda
|
||||
(() 0)
|
||||
((x) x)
|
||||
((x y) `(@@ add ,x ,y))
|
||||
((x y . rest) `(@@ add ,x (@+ ,y ,@rest)))))
|
||||
|
||||
(define @*
|
||||
(match-lambda*
|
||||
(case-lambda
|
||||
(() 1)
|
||||
((x) x)
|
||||
((x y) `(@@ mul ,x ,y))
|
||||
((x y . rest) `(@@ mul ,x (@* ,y ,@rest)))))
|
||||
|
||||
(define @-
|
||||
(match-lambda*
|
||||
(case-lambda
|
||||
((x) `(@@ sub 0 ,x))
|
||||
((x y) `(@@ sub ,x ,y))
|
||||
((x y . rest) `(@@ sub ,x (@+ ,y ,@rest)))))
|
||||
|
||||
(define @/
|
||||
(match-lambda*
|
||||
(case-lambda
|
||||
((x) `(@@ div 1 ,x))
|
||||
((x y) `(@@ div ,x ,y))
|
||||
((x y . rest) `(@@ div ,x (@* ,y ,@rest)))))
|
||||
|
@ -296,7 +296,7 @@
|
|||
;;;
|
||||
|
||||
(define @cons*
|
||||
(match-lambda*
|
||||
(case-lambda
|
||||
((x) x)
|
||||
((x y) `(@cons ,x ,y))
|
||||
((x y . rest) `(@cons ,x (@cons* ,y ,@rest)))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue