develooper Front page | perl.perl6.language | Postings from October 2001

Re: Just a thought...

Thread Previous | Thread Next
From:
Piers Cawley
Date:
October 9, 2001 14:26
Subject:
Re: Just a thought...
Message ID:
m21ykccxpe.fsf@localhost.localdomain
Michael G Schwern <schwern@pobox.com> writes:

> On Tue, Oct 09, 2001 at 11:22:02AM +0100, Piers Cawley wrote:
> > Does the change from ?: to ??:: mean that we can have '?' as a valid
> > character in an identifier? I quite like the ruby/scheme idiom of
> > having boolean methods ending in a question mark. eg:
> > 
> >     sub is_visible? {...}
> 
> I was gonna suggest that pre-Apoc 3 but ran into the same trouble with ?:
> 
> Hmm, $obj.meth! is a syntax error, but func! isn't.  Damn.
> 
> For those of you that don't know, func! is another Ruby idiom that
> differentiates between the version of a function that returns it's
> results and the one which alters it's arguments in place.

Actually, I think it was a scheme thing first, and once you know it
it's a really handy convention.

-- 
Piers

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About