From 50cfb5533a31afb7d85c0574ab6359efbc4f164e Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 1 Jun 2010 21:25:59 +0000 Subject: * algebra/list.spad.pamphlet: Use builtin functions. --- src/interp/g-opt.boot | 5 +++-- src/interp/g-util.boot | 21 ++++++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'src/interp') diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index eccf8e73..a582c8a2 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -407,12 +407,13 @@ $VMsideEffectFreeOperators == %imul %iadd %isub %igcd %ilcm %ipow %imin %imax %ieven? %iodd? %iinc %feq %flt %fle %fgt %fge %fmul %fadd %fsub %fexp %fmin %fmax %float? %fpow %nil %pair? %lconcat %llength %lfirst %lsecond %lthird - %hash %ismall? %string? %ceq %clt %cle %cgt %cge %c2i %i2c) + %lreverse %lempty? %hash %ismall? %string? + %ceq %clt %cle %cgt %cge %c2i %i2c) ++ List of simple VM operators $simpleVMoperators == append($VMsideEffectFreeOperators, - ["CONS","LIST","VECTOR","STRINGIMAGE",'%gensym, + ["CONS","LIST","VECTOR","STRINGIMAGE",'%gensym, '%lreverse_!, "MAKE-FULL-CVEC","BVEC-MAKE-FULL","COND"]) ++ Return true if the `form' is semi-simple with respect to diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot index a3674a01..d949a6fb 100644 --- a/src/interp/g-util.boot +++ b/src/interp/g-util.boot @@ -299,16 +299,19 @@ for x in [ -- list contants -- ['%nil, :'NIL], -- unary list operations - ['%head, :'CAR], - ['%makepair,:'CONS], - ['%lfirst, :'CAR], - ['%llength, :'LIST_-LENGTH], - ['%lsecond, :'CADR], - ['%lthird, :'CADDR], - ['%pair?, :'CONSP], - ['%tail, :'CDR], + ['%head, :'CAR], + ['%makepair, :'CONS], + ['%lempty?, :'NULL], + ['%lfirst, :'CAR], + ['%llength, :'LIST_-LENGTH], + ['%lreverse, :'REVERSE], + ['%lreverse_!,:'NREVERSE], + ['%lsecond, :'CADR], + ['%lthird, :'CADDR], + ['%pair?, :'CONSP], + ['%tail, :'CDR], -- binary list operations - ['%lconcat, :'APPEND], + ['%lconcat, :'APPEND], -- symbol unary functions ['%gensym, :'GENSYM], -- cgit v1.2.3