guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: for-each et al


From: Ludovic Courtès
Subject: Re: for-each et al
Date: Wed, 05 Mar 2014 23:32:16 +0100
User-agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux)

Andy Wingo <address@hidden> skribis:

> On Tue 04 Mar 2014 23:35, address@hidden (Ludovic Courtès) writes:

[...]

>> I suspect SCM_SETCAR/SCM_SETCDR are actually more widespread than
>> their Scheme counterparts, and probably much harder to avoid.  What
>> can we do with them?
>
> Depends.  If they are used to build up a data structure, I wouldn't
> worry -- it's not detectable by Scheme except via continuation hacks.
> There are only about 70 places in libguile itself that we use SETCDR,
> and 30 or so for SETCAR.  Not that bad.  About 40 callers of
> scm_reverse_x though.

Right, maybe that’s not too scary.

>> Another issue: what about elisp?  It needs mutable pairs, but we don’t
>> want to have it use a disjoint type.
>
> A very good question, and I don't know.  Would a tc7 mutable-pair type
> be that bad?  Could we do it with a tc3 instead?  Dunno.  This could
> make it impossible.

The question IMO is not about tagging, but about having a disjoint type.
I think the whole idea behind elisp support was that it could use the
very same data types as Scheme code, which would no longer be the case
if mutable pairs and immutable pairs were disjoint.

>>>   * Introducing a #!lang facility, and having programs with #!lang make
>>>     immutable pairs
>>
>> Not really fan of the idea.  :-)
>
> Why not?  It makes it clear what's in scope at the beginning of a file,
> which is a nice advantage.

I have mixed feelings: as a way to save a few use-modules, it’s looks
both convenient and hackish (you can’t #!lang several languages
typically, right?).

Thanks,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]