mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +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:
|
;;; Code:
|
||||||
|
|
||||||
(define-module (system il macros)
|
(define-module (system il macros)
|
||||||
:use-module (ice-9 match))
|
:use-module (srfi srfi-16))
|
||||||
|
|
||||||
(define (make-label) (gensym ":L"))
|
(define (make-label) (gensym ":L"))
|
||||||
(define (make-sym) (gensym "_"))
|
(define (make-sym) (gensym "_"))
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
;;
|
;;
|
||||||
;; (@if X (@and Y...) #f)
|
;; (@if X (@and Y...) #f)
|
||||||
(define @and
|
(define @and
|
||||||
(match-lambda*
|
(case-lambda
|
||||||
(() #t)
|
(() #t)
|
||||||
((x) x)
|
((x) x)
|
||||||
((x . rest) `(@if ,x (@and ,@rest) #f))))
|
((x . rest) `(@if ,x (@and ,@rest) #f))))
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
;;
|
;;
|
||||||
;; (@let ((@_ X)) (@if @_ @_ (@or Y...)))
|
;; (@let ((@_ X)) (@if @_ @_ (@or Y...)))
|
||||||
(define @or
|
(define @or
|
||||||
(match-lambda*
|
(case-lambda
|
||||||
(() #f)
|
(() #f)
|
||||||
((x) x)
|
((x) x)
|
||||||
((x . rest)
|
((x . rest)
|
||||||
|
@ -86,27 +86,27 @@
|
||||||
;(define (@>= x y) `(@@ ge? ,x ,y))
|
;(define (@>= x y) `(@@ ge? ,x ,y))
|
||||||
|
|
||||||
(define @+
|
(define @+
|
||||||
(match-lambda*
|
(case-lambda
|
||||||
(() 0)
|
(() 0)
|
||||||
((x) x)
|
((x) x)
|
||||||
((x y) `(@@ add ,x ,y))
|
((x y) `(@@ add ,x ,y))
|
||||||
((x y . rest) `(@@ add ,x (@+ ,y ,@rest)))))
|
((x y . rest) `(@@ add ,x (@+ ,y ,@rest)))))
|
||||||
|
|
||||||
(define @*
|
(define @*
|
||||||
(match-lambda*
|
(case-lambda
|
||||||
(() 1)
|
(() 1)
|
||||||
((x) x)
|
((x) x)
|
||||||
((x y) `(@@ mul ,x ,y))
|
((x y) `(@@ mul ,x ,y))
|
||||||
((x y . rest) `(@@ mul ,x (@* ,y ,@rest)))))
|
((x y . rest) `(@@ mul ,x (@* ,y ,@rest)))))
|
||||||
|
|
||||||
(define @-
|
(define @-
|
||||||
(match-lambda*
|
(case-lambda
|
||||||
((x) `(@@ sub 0 ,x))
|
((x) `(@@ sub 0 ,x))
|
||||||
((x y) `(@@ sub ,x ,y))
|
((x y) `(@@ sub ,x ,y))
|
||||||
((x y . rest) `(@@ sub ,x (@+ ,y ,@rest)))))
|
((x y . rest) `(@@ sub ,x (@+ ,y ,@rest)))))
|
||||||
|
|
||||||
(define @/
|
(define @/
|
||||||
(match-lambda*
|
(case-lambda
|
||||||
((x) `(@@ div 1 ,x))
|
((x) `(@@ div 1 ,x))
|
||||||
((x y) `(@@ div ,x ,y))
|
((x y) `(@@ div ,x ,y))
|
||||||
((x y . rest) `(@@ div ,x (@* ,y ,@rest)))))
|
((x y . rest) `(@@ div ,x (@* ,y ,@rest)))))
|
||||||
|
@ -296,7 +296,7 @@
|
||||||
;;;
|
;;;
|
||||||
|
|
||||||
(define @cons*
|
(define @cons*
|
||||||
(match-lambda*
|
(case-lambda
|
||||||
((x) x)
|
((x) x)
|
||||||
((x y) `(@cons ,x ,y))
|
((x y) `(@cons ,x ,y))
|
||||||
((x y . rest) `(@cons ,x (@cons* ,y ,@rest)))))
|
((x y . rest) `(@cons ,x (@cons* ,y ,@rest)))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue