dido/arcueid — Issue #19: Strange behavior in the while macro
Author: dido
Created: 2012-01-03 08:16:17+00:00
State: open

In reference Arc:

arc> ((fn (xs acc) (while (= xs (cdr xs)) (assign acc (* acc (car xs)))) acc) '(1 2 3 4 5 6 7) 1)
5040

In Arcueid:

arc> ((fn (xs acc) (while (= xs (cdr xs)) (assign acc (* acc (car xs)))) acc) '(1 2 3 4 5 6 7) 1)
2

Strange that tracing the expansion of the while macro in Arcueid produces the following expansion:

((fn (xs acc) ((rfn g3121 (g3120) (when g3120 (assign acc (* acc (car xs))) (g3121 (= xs (cdr xs))))) (= xs (cdr xs))) acc) '(1 2 3 4 5 6 7) 1)

which evaluates to 5040 in Arcueid as well!