mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
make define-inline more usable from external modules
* module/system/il/inline.scm (define-inline): Use @ when accessing module vars so that other modules don't need to import all of our modules. However case-lambda is still needed.
This commit is contained in:
parent
fd4da4fae6
commit
46ccd0bbf9
1 changed files with 12 additions and 9 deletions
|
@ -54,16 +54,19 @@
|
|||
((number? exp)
|
||||
`(make-ghil-quote #f #f ,exp))
|
||||
(else (error "bad consequent yall" exp))))
|
||||
`(set! *inline-table*
|
||||
(assq-set! *inline-table*
|
||||
`(set! (@ (system il inline) *inline-table*)
|
||||
(assq-set! (@ (system il inline) *inline-table*)
|
||||
,sym
|
||||
(case-lambda
|
||||
,@(let lp ((in clauses) (out '()))
|
||||
(if (null? in)
|
||||
(reverse (cons '(else #f) out))
|
||||
(lp (cddr in)
|
||||
(cons `(,(car in)
|
||||
,(consequent (cadr in))) out))))))))
|
||||
(let ((make-ghil-inline (@ (system il ghil) make-ghil-inline))
|
||||
(make-ghil-quote (@ (system il ghil) make-ghil-quote))
|
||||
(try-inline (@ (system il inline) try-inline)))
|
||||
(case-lambda
|
||||
,@(let lp ((in clauses) (out '()))
|
||||
(if (null? in)
|
||||
(reverse (cons '(else #f) out))
|
||||
(lp (cddr in)
|
||||
(cons `(,(car in)
|
||||
,(consequent (cadr in))) out)))))))))
|
||||
|
||||
(define (try-inline head-value args)
|
||||
(and=> (assq-ref *inline-table* head-value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue