From: James Edward Gray II Date: 2007-06-08T21:23:20+09:00 Subject: Re: Gecode/R - Request for syntax feedback On Jun 8, 2007, at 3:18 AM, Andreas Launila wrote: > James Edward Gray II wrote: >> On Jun 7, 2007, at 10:07 AM, Andreas Launila wrote: >> >>> I have added that syntax to the examples to get a feel for it: >>> http://gecoder.lokorin.org/dev/wiki/Syntax_test#constrain_. >>> 2A_arguments >>> >>> It's a bit bulkier at times, but is probably more conventional >>> (possibly >>> easier to get to grips with?). >> >> I agree that it lacks the sex appeal of the RSpec approach. >> However, it >> does allow us to avoid wrapping all variables and core class hacking, >> which I consider big wins. I would be willing to pay the price. >> > > I'm not really sure that the cost compared to the others is that much > lower. The following are the changes necessary to make the others work > as far as I'm aware, please correct me if I'm missing something. > > * Custom enums with variables have to be wrapped before use (arrays > and > matrices created through the convenience methods are wrapped there). > * It becomes harder to create temporary arrays of variables, e.g. > [x,y]. > Instead the user has to use variable([x,y]) or something similar (or > possibly IntVar.array(x,y) if that's better). > > Beyond that I can not see anything that requires wrapping or altering > core classes (or any other non-gecode classes for that matter). You are probably right. If we go with the wrapping approach, I just think the most important thing is to make sure we are careful to support custom data structures as painlessly as possible. James Edward Gray II