From gwking at metabang.com Wed Feb 20 14:00:43 2008 From: gwking at metabang.com (Gary King) Date: Wed, 20 Feb 2008 09:00:43 -0500 Subject: [Metabang-bind-devel] Re: bind macro In-Reply-To: <8f9aaf260802180731x56a9ff28x40da7f9ee63be523@mail.gmail.com> References: <8f9aaf260802180731x56a9ff28x40da7f9ee63be523@mail.gmail.com> Message-ID: <8AC75CCA-94B6-461B-AF51-B140354F876B@metabang.com> (cc'd to list) Hi Hamish, I agree that bind should not use cl:values to determine how to bind things. It's a left over bit from those dear dead days of long ago... I'll grab your patch over the weekend (or maybe next weekend ). I'm currently more swamped than usual. thanks again, On Feb 18, 2008, at 10:31 AM, Hamish Harvey wrote: > Hi Gary, > > I've been finding your bind macro very useful. I don't think it should > steal `values' as an identifier, though. I just did a "darcs send" > which I expected to allow me to add an explanatory note. > > I expected > > (bind (((values foo bar) (values 1 2 3))) ...) > > to give me a destructuring-bind, but got a (multiple-value-bind (foo > bar) ...) instead. > > The patch just removes the handling of cl:values, leaving the keyword > :values, which might not suit you if you use cl:values yourself ... > > Cheers, > Hamish > > > -- > Hamish Harvey > Research Associate, School of Civil Engineering and Geosciences, > Newcastle University -- Gary Warren King, metabang.com Cell: (413) 559 8738 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM From attila.lendvai at gmail.com Fri Feb 22 14:49:39 2008 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Fri, 22 Feb 2008 15:49:39 +0100 Subject: [Metabang-bind-devel] bug with empty bindings Message-ID: hi Gary, (bind () 1 2) expands to a mere single 1. sorry for not sending a patch with a test case, but we are deep in something else... -- attila From gwking at metabang.com Mon Feb 25 12:47:11 2008 From: gwking at metabang.com (Gary King) Date: Mon, 25 Feb 2008 07:47:11 -0500 Subject: [Metabang-bind-devel] Re: bind macro In-Reply-To: <8f9aaf260802180731x56a9ff28x40da7f9ee63be523@mail.gmail.com> References: <8f9aaf260802180731x56a9ff28x40da7f9ee63be523@mail.gmail.com> Message-ID: <51AC9522-0183-42EC-9F8E-839DCBDD69FF@metabang.com> Hi Hamish, I've almost finished what I want to do vis-a-vis your patch. Since I've got a lot of projects that use the older syntax, I'm also adding a variable that controls how a binding form like ((values a b) (foo)) is interpreted and writing some tests and updating the documentation... It gets to be a bit crazy! . In any case, the change will go real soon now. thanks again, On Feb 18, 2008, at 10:31 AM, Hamish Harvey wrote: > Hi Gary, > > I've been finding your bind macro very useful. I don't think it should > steal `values' as an identifier, though. I just did a "darcs send" > which I expected to allow me to add an explanatory note. > > I expected > > (bind (((values foo bar) (values 1 2 3))) ...) > > to give me a destructuring-bind, but got a (multiple-value-bind (foo > bar) ...) instead. > > The patch just removes the handling of cl:values, leaving the keyword > :values, which might not suit you if you use cl:values yourself ... > > Cheers, > Hamish > > > -- > Hamish Harvey > Research Associate, School of Civil Engineering and Geosciences, > Newcastle University -- Gary Warren King, metabang.com Cell: (413) 559 8738 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM From attila.lendvai at gmail.com Mon Feb 25 14:32:26 2008 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Mon, 25 Feb 2008 15:32:26 +0100 Subject: [Metabang-bind-devel] Re: bind macro In-Reply-To: <51AC9522-0183-42EC-9F8E-839DCBDD69FF@metabang.com> References: <8f9aaf260802180731x56a9ff28x40da7f9ee63be523@mail.gmail.com> <51AC9522-0183-42EC-9F8E-839DCBDD69FF@metabang.com> Message-ID: > I've got a lot of projects that use the older syntax, I'm also adding > a variable that controls how a binding form like ((values a b) (foo)) > is interpreted and writing some tests and updating the Gary, please make an option that if this compatibility variable is :warn (or something similar). then a style-warning is issued when bind thinks that it's an old VALUES syntax that is going to be interpreted as a destructuring-bind. i'd suggest that to be the default value, imho that would make the easiest transition for the users. i remember when :values became mandatory and random spots in our code expanded to something unexpected. in fact i sent the patch that restored the old behavior after the refactor, but seems like that is also biting people, so that's why i think that :warn should make it clear what's going on. -- attila From gwking at metabang.com Mon Feb 25 23:02:25 2008 From: gwking at metabang.com (Gary King) Date: Mon, 25 Feb 2008 18:02:25 -0500 Subject: [Metabang-bind-devel] Re: bind macro In-Reply-To: References: <8f9aaf260802180731x56a9ff28x40da7f9ee63be523@mail.gmail.com> <51AC9522-0183-42EC-9F8E-839DCBDD69FF@metabang.com> Message-ID: <1E682EA1-871C-47FC-BEE6-69191DF509A6@metabang.com> Yes, I'm doing to warn by default (with a variable to control it and choose the behavior for cl:values). That's what has added to the complication but it's all a good thing! On Feb 25, 2008, at 9:32 AM, Attila Lendvai wrote: >> I've got a lot of projects that use the older syntax, I'm also adding >> a variable that controls how a binding form like ((values a b) (foo)) >> is interpreted and writing some tests and updating the > > Gary, please make an option that if this compatibility variable is > :warn (or something similar). then a style-warning is issued when bind > thinks that it's an old VALUES syntax that is going to be interpreted > as a destructuring-bind. i'd suggest that to be the default value, > imho that would make the easiest transition for the users. > > i remember when :values became mandatory and random spots in our code > expanded to something unexpected. in fact i sent the patch that > restored the old behavior after the refactor, but seems like that is > also biting people, so that's why i think that :warn should make it > clear what's going on. > > -- > attila -- Gary Warren King, metabang.com Cell: (413) 559 8738 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM