egallesio / STklos

STklos Scheme
http://stklos.net
GNU General Public License v2.0
67 stars 17 forks source link

Rewrite rule for `equal?` #649

Open jpellegrini opened 1 month ago

jpellegrini commented 1 month ago

Hi @egallesio ! Maybe this one is interesting? :)

This is the result:

stklos> (disassemble-expr '(equal? a b))

000:  GLOBAL-REF-PUSH      0
002:  GLOBAL-REF           1
004:  IN-EQUAL

stklos> (disassemble-expr '(equal? a #eof))

000:  GLOBAL-REF-PUSH      0
002:  CONSTANT             1
004:  IN-EQ

stklos> (disassemble-expr '(equal? 25 #eof))

000:  IM-FALSE

And maybe the same could be done for eqv?...

jpellegrini commented 1 month ago

And maybe the same could be done for eqv?...

And member, and memv, maybe?