Re: Indenting

2001-10-16 Thread Rafael Garcia-Suarez
Excuse me for dropping this into the discussion, but this reminds me a proposal made (by me;-) in p5p last month : define a new prototype (") that allows to define quotelike functions. Example : sub rot13 (") { my $s = shift; $s =~ tr/A-Za-z/N-ZM-An-zm-A/; return $s; } print ro

Re: Indenting

2001-10-16 Thread Michael G Schwern
On Tue, Oct 16, 2001 at 08:31:31PM -0700, David Whipp wrote: > > Is chomp? just a bad example, or is there some utility in asking if a > > string has already been chomped? > > The query is asking what the string would look like, if it were chomped. That's a weird use of a query method. In fact,

RE: Indenting

2001-10-16 Thread David Whipp
> Is chomp? just a bad example, or is there some utility in asking if a > string has already been chomped? The query is asking what the string would look like, if it were chomped. Dave.

Re: Indenting

2001-10-16 Thread Michael G Schwern
On Tue, Oct 16, 2001 at 08:53:07PM -0500, David M. Lloyd wrote: > What about 'chomp?' for query but 'chomp' (no decoration) for operation? Is chomp? just a bad example, or is there some utility in asking if a string has already been chomped? -- Michael G. Schwern <[EMAIL PROTECTED]>http

RE: Indenting

2001-10-16 Thread David M. Lloyd
On Tue, 16 Oct 2001, David Whipp wrote: > . I know it uses valuable characters, but adding C to > identify a query, and C for an operation does not seem > unreasonable. What about 'chomp?' for query but 'chomp' (no decoration) for operation? I think using ? on method names is kind of cute.

RE: Indenting

2001-10-16 Thread David Whipp
> Well, as discussed briefly in an earlier thread, > http:[EMAIL PROTECTED]/msg08514.html > if we allow ! in function names, we can distinguish between the normal > and in-place versions of functions without proliferating the number of > keywords. > > chomp! $string; > my $chomped_string

Re: Indenting

2001-10-16 Thread Michael G Schwern
On Wed, Oct 17, 2001 at 07:56:04AM +1000, Damian Conway wrote: >> Well, as discussed briefly in an earlier thread, >> http:[EMAIL PROTECTED]/msg08514.html >> if we allow ! in function names, we can distinguish between the normal >> and in-place versions of functions without prolif

Re: Indenting

2001-10-16 Thread Damian Conway
> Well, as discussed briefly in an earlier thread, > http:[EMAIL PROTECTED]/msg08514.html > if we allow ! in function names, we can distinguish between the normal > and in-place versions of functions without proliferating the number of > keywords. > > chomp! $string;

Re: Indenting

2001-10-16 Thread Michael G Schwern
On Tue, Oct 16, 2001 at 12:56:16PM +0200, Bart Lateur wrote: > Which reminds me... one of the less attractive features of here docs is > the fact that the quoted document always has to end in a newline. That > is annoying at times. > If there was an easy way to chomp() that newline and return the

Re: Indenting

2001-10-16 Thread Aaron Sherman
On Tue, Oct 16, 2001 at 09:30:44AM -0700, David Wheeler wrote: > > That's part of the reason that I almost never use here docs, but the > qq{} operator, instead. No need for a closing newline. I have not read the RFC, but I do agree that qq is the way to go for formatted content. Or, perhaps som

Re: Indenting

2001-10-16 Thread David Wheeler
On Tue, 2001-10-16 at 03:56, Bart Lateur wrote: > Which reminds me... one of the less attractive features of here docs is > the fact that the quoted document always has to end in a newline. That > is annoying at times. That's part of the reason that I almost never use here docs, but the qq{} ope

Re: Indenting

2001-10-16 Thread Bart Lateur
On Mon, 15 Oct 2001 20:53:24 -0400, Michael G Schwern wrote: >Not only is it a bit faster than the s/^\s+//gm regex, but it is also >more flexible. > >if( $self->feeling_snooty ) { >print <<'POEM'; >Sometimes >form has to follow function >

Re: Indenting

2001-10-15 Thread Michael G Schwern
On Sat, Oct 13, 2001 at 04:30:08PM +0200, raptor wrote: > I was looking at TPJ one-liners and saw this : > > #32A trick for indenting here strings > > ($definition = <<'FINIS') =~ s/^\s+//gm; > The five varieties of camelids are the familliar >

Re: Indenting

2001-10-15 Thread RaFaL Pocztarski
Bart Lateur wrote: > I can remember that an even smarter version of this was discussed in an > RFC -- I don't remember which -- so it's not unlikely that it will be > part of Perl6. RFC162 - Heredoc contents: http://dev.perl.org/rfc/162.html Apocalypse 2: http://dev.perl.org/perl6/apocalypse/2#

Re: Indenting

2001-10-14 Thread Bart Lateur
On Sat, 13 Oct 2001 16:30:08 +0200, raptor wrote: >I was looking at TPJ one-liners and saw this : > >#32A trick for indenting here strings > >($definition = <<'FINIS') =~ s/^\s+//gm; >The five varieties of camelids are the familliar >camel, his

Indenting

2001-10-13 Thread raptor
Hi, I was looking at TPJ one-liners and saw this : #32A trick for indenting here strings ($definition = <<'FINIS') =~ s/^\s+//gm; The five varieties of camelids are the familliar camel, his friends the llama and the alpaca, and the rather less well-known gu