From: Andreas Launila Date: 2007-06-07T17:58:49+09:00 Subject: Re: Gecode/R - Request for syntax feedback Andreas Launila wrote: > James Edward Gray II wrote: >> On Jun 6, 2007, at 12:35 PM, Andreas Launila wrote: >>> Something more on the form of the rest of the syntax >>> would probably be >>> >>> constrain element(array, x).equal(y) >>> >>> It just doesn't read as well to me. Maybe there's a better way of >>> representing constraints where the function has to take multiple >>> arguments, such as returning an helper with only one method, i.e. as >>> follows. >>> >>> constrain element(x).in(array).equal(y) >> I would say avoiding core class modification is important. If that >> means we need element(), that's probably just a price we need to pay, in >> my opinion. >> >> See my earlier comment about proxy objects for another option though. >> > > I will write up some similar syntax examples with proxy objects to see > how big the difference is. > Examples: http://gecoder.lokorin.org/dev/wiki/Syntax_test#Proxy_objects I have assumed that it's in this case okay to shadow methods such as #sort since if the enum is passed to a wrapping method then it should only be used with finite-domain variables, which do not have any defined way of comparison (similarly for min and max). -- Andreas Launila