Re: struct-copy func

2007-08-21 Thread Ludovic Courtès
Hi, Kevin Ryde <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] (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

Re: struct-copy func

2007-08-20 Thread Kevin Ryde
[EMAIL PROTECTED] (Ludovic Courtès) writes: > > `struct-copy' must check fields permission I didn't want to do that. > `s' fields must be updated Ah yes, I forgot that. > `o' fields cannot be copied I think. I had in mind just bitwise copying them. But I guess that slightly defeats the purpos

Re: struct-copy func

2007-08-20 Thread Ludovic Courtès
Hi, Good idea. Kevin Ryde <[EMAIL PROTECTED]> writes: > memcpy (new_st_data, st_data, n_words * sizeof(scm_t_bits)); That's not possible: `struct-copy' must check fields permission and type before copying. For instance, `s' fields must be updated, and a struct with `o' fields cannot be copie

struct-copy func

2007-08-16 Thread Kevin Ryde
This is an idea I had for copying structures, mainly to make a `record-copy' function (just an alias of struct-copy). I've found it pretty useful. You can do a record copy with `record-constructor' and a map over `record-accessor' for each field, but of course a block copy is heaps more efficient