From: hakunin Date: 2008-06-17T22:18:56+09:00 Subject: Re: print(true and true) #=> the parenthesis issue On Jun 17, 9:11 am, hakunin wrote: > On Jun 17, 8:52 am, Robert Klemme wrote: > > > > > On 17 Jun., 14:42, hakunin wrote: > > > > > Having a feature that makes the language simple which is not > > > > used by anyone (or only rarely) does not justify complicating the > > > > parser more than necessary. > > > > I wouldn't say that this is unused.  I came across this issue when > > > trying to write an ACL method, looking something like this: > > > only( a :guest and not the @user ) do end # => 'a' and 'the' are both > > > methods returning boolean based on supplied arg > > > Not sure how this can work since obviously you want to evaluate the > > ACL on access time and not when you define it.  Why don't you use a > > block? > > > only { a :guest and not the @user } > > > Cheers > > > robert > > I don't want to go too off-topic, as I just wanted to show a usage > example. To be quick - I'm doing web dev, and in my case the role > "guest" and the object @user are stored in current_user session > object. The method is supposed to be like this: only(who){ #do > something for this particular "who" }-- the block passed to "only" > will run only if the boolean returns true. It will make more sense if I mentioned this is used by designer in html templates to output or omit certain parts. : ) But that's beyond the subject, once again.