[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Guile Assembler
From: |
Mark H Weaver |
Subject: |
Re: Guile Assembler |
Date: |
Fri, 04 Sep 2015 12:58:13 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Panicz Maciej Godek <address@hidden> writes:
> Actually, the code is written in such way that "loop" is actually a
> macro such that
>
> (loop (values 4 (list 5 6)))
>
> would expand to
>
> (loop* (values->list (values 4 (list 5 6))))
>
> where loop* takes lists as inputs and (values->list call) is a syntax
> defined as (call-with-values (lambda () call) list), so I think it is
> a proper Scheme code which does not rely on any undefined behaviors.
Ah, okay. You're right, this is fine, sorry for the noise.
> It has some drawbacks -- among others, that loop is no longer first
> class (although it could be made obtainable easily) and the resulting
> code is rather inefficient, but it ought to behave properly.
Indeed, it's not good for looping constructs to do heap allocation. If
the loop would not otherwise require allocation, then using such a
looping construct will result in a dramatic slowdown.
Mark