[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: struct-copy func
From: |
Ludovic Courtès |
Subject: |
Re: struct-copy func |
Date: |
Tue, 21 Aug 2007 09:49:14 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
Hi,
Kevin Ryde <address@hidden> writes:
> address@hidden (Ludovic Courtès) writes:
>>
>> `struct-copy' must check fields permission
>
> I didn't want to do that.
I think it has to be done, otherwise that'd just make field permissions
useless.
>> `o' fields cannot be copied I think.
>
> I had in mind just bitwise copying them. But I guess that slightly
> defeats the purpose of such fields, and could conceivably be a bit evil.
Indeed. I believe it should be an error to try to copy a struct with
such fields.
> I might rethink it as just a record-copy, since plain records have none
> of those questions. But that'd need at least `record?' down in C code
> for a type check, so it might have to wait until most of the record
> stuff is in C.
Better leave records as Scheme code IMO. If you add the above rules to
`struct-copy', then you will be able to
`(define record-copy struct-copy)' and it will actually work because
records have no opaque fields.
Thanks,
Ludovic.