[Chicken-users] Hygienic Chicken's desftruct issue

2008-08-25 Thread Alonso Andres
Hello, it seems that defstruct on a copy or set! operation doesn't let you set the value of a field to an empty list. For instance, test the following code: (use defstruct) (defstruct test a b) (define t1 (make-test a: '(1 2 3) b: '(4 5 6))) (define t2 (test-copy t1 a: '()))

Re: [Chicken-users] Hygienic Chicken's desftruct issue

2008-08-25 Thread Peter Bex
On Mon, Aug 25, 2008 at 03:29:30PM -0300, Alonso Andres wrote: > Hello, > > it seems that defstruct on a copy or set! operation doesn't let you > set the value of a field to an empty list. > > Probably a fix for this would be iterating through the arguments list > to know which keys weren't reall

Re: [Chicken-users] Hygienic Chicken's desftruct issue

2008-08-25 Thread Alonso Andres
On Mon, Aug 25, 2008 at 3:53 PM, Peter Bex <[EMAIL PROTECTED]> wrote: > > This was a silly mistake of mine (empty list is eq? to an empty list, but > a list with anything in it creates a new unique cons cell, which is what > that code should have done). Thanks for catching it! It's been > fixed an

Re: [Chicken-users] Hygienic Chicken's desftruct issue

2008-08-25 Thread Peter Bex
On Mon, Aug 25, 2008 at 05:04:50PM -0300, Alonso Andres wrote: > Hi Peter, it works perfectly now, thanks! > > I'd also like to suggest changing the procedure -copy to > copy-, since the former seems like we're dealing with a field > called "copy" (because the convention of creating procedures lik

Re: [Chicken-users] Hygienic Chicken's desftruct issue

2008-08-25 Thread John Cowan
Peter Bex scripsit: > Perhaps you (or someone else on the list?) can think of a better name > that can be prefixed, to remove all confusion? Ideally it'd be something > which has been done before in Scheme, or failing that, something people > would have absolutely no preconceptions about. "clone-

Re: [Chicken-users] Hygienic Chicken's desftruct issue

2008-08-25 Thread Alonso Andres
On Mon, Aug 25, 2008 at 5:14 PM, Peter Bex <[EMAIL PROTECTED]> wrote: > Perhaps you (or someone else on the list?) can think of a better name > that can be prefixed, to remove all confusion? Ideally it'd be something > which has been done before in Scheme, or failing that, something people > would

Re: [Chicken-users] Hygienic Chicken's desftruct issue

2008-08-25 Thread Alan Post
On Mon, Aug 25, 2008 at 04:31:42PM -0400, John Cowan wrote: > Peter Bex scripsit: > > > Perhaps you (or someone else on the list?) can think of a better name > > that can be prefixed, to remove all confusion? Ideally it'd be something > > which has been done before in Scheme, or failing that, some

Re: [Chicken-users] Hygienic Chicken's desftruct issue

2008-08-25 Thread Elf
On Mon, 25 Aug 2008, Alan Post wrote: On Mon, Aug 25, 2008 at 04:31:42PM -0400, John Cowan wrote: Peter Bex scripsit: Perhaps you (or someone else on the list?) can think of a better name that can be prefixed, to remove all confusion? Ideally it'd be something which has been done before in Sc

Re: [Chicken-users] Hygienic Chicken's desftruct issue

2008-08-27 Thread Peter Bex
On Mon, Aug 25, 2008 at 05:49:14PM -0300, Alonso Andres wrote: > On Mon, Aug 25, 2008 at 5:14 PM, Peter Bex <[EMAIL PROTECTED]> wrote: > > > Perhaps you (or someone else on the list?) can think of a better name > > that can be prefixed, to remove all confusion? Ideally it'd be something > > which