mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-17 01:00:20 +02:00
Memoized expressions are pairs, not SMOBs
* libguile/memoize.c (MAKMEMO): Memoized objects are pairs now, not SMOBs. This lets eval.scm destructure them more efficiently. (scm_print_memoized, scm_memoized_p, scm_memoized_expression_typecode) (scm_memoized_expression_data): Remove these interfaces. (unmemoize, scm_memoize_variable_access_x): Remove SMOB type checks. (scm_init_memoize): Remove SMOB type definition. * libguile/memoize.h (scm_tc16_memoized, SCM_MEMOIZED_P) (scm_memoized_expression_typecode, scm_memoized_expression_data) (scm_memoized_p): Remove declarations. * libguile/validate.h (SCM_VALIDATE_MEMOIZED): Remove declaration. * libguile/eval.c (eval): Remove memoized type check, and inline the inum unpacking. * module/ice-9/eval.scm (memoized-expression-case): Use car and cdr to destructure memoized expressions. A big win!
This commit is contained in:
parent
c450b47723
commit
0720f70ed7
5 changed files with 11 additions and 69 deletions
|
@ -264,8 +264,8 @@
|
|||
(lambda (x)
|
||||
(syntax-case x ()
|
||||
((_ mx c ...)
|
||||
#'(let ((tag (memoized-expression-typecode mx))
|
||||
(data (memoized-expression-data mx)))
|
||||
#'(let ((tag (car mx))
|
||||
(data (cdr mx)))
|
||||
(mx-match mx data tag c ...)))))))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue