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

how about just juxtaposing? (Re: Sane "+" string concat proposal)

Thread Previous | Thread Next
From:
Jarkko Hietaniemi
Date:
April 24, 2001 12:33
Subject:
how about just juxtaposing? (Re: Sane "+" string concat proposal)
Message ID:
20010424143239.Z14782@chaos.wustl.edu
I think the magical "+" isn't going to work.

Has the road of just putting things next to each other been extensively
tried?  It works for Awk...  "juxtapose", the Famous Invisible Perl
Operator.

	Perl 5			Perl 6

	$a = $b . $c;		$a = $b $c;	# or $b$c
	$a = "foo".$c;		$a = "foo" $c;	# or "foo"$c
	$a = foo . $c;		$a = foo$c;	# foo $c wouldn't work...
	$a = $c . foo;		$a = ${c}foo	# (if foo is a function)
	$a = foo() . $c;	$a = foo() $c;
	$a = $c . foo();	$a = $c foo();
	$a = $b->c . $d;	$a = $b->c $d;	# or $b->c$d;

I can see that the indirect objects can be painful

	my $fh = open(...);
	print $fh $blah;

but maybe we can spread magic thickly enough on filehandles so that
"concat to a filehandle" means output...

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

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