Re: substitution and assignment fun ( was RE: Becoming Disenheartened )

2004-10-01 Thread Chris Devers
On Fri, 1 Oct 2004, Nicolay A. Vasiliev wrote:

> No doubt please, I know about regular expressions and Python/Ruby 
> support them fully. I only showed the approach of method calling. 
> There could be not "replace" method.

You're arguing about semantics, but you concede that the functionality 
you're describing exists just as succinctly in both languages. 

So, again -- so what ? It's a difference without a distinction. 

Python & Ruby implement these operations with a .method() syntax.

Perl generally implements them with a function() syntax.

The two sides are far more similar than different. Who cares?



-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: substitution and assignment fun ( was RE: Becoming Disenheartened )

2004-10-01 Thread Nicolay A. Vasiliev
No doubt please, I know about regular expressions and Python/Ruby 
support them fully. I only showed the approach of method calling. There 
could be not "replace" method.

William M West wrote:

Python and Ruby don't write the code for me. But look at this Python
code:
s = "I am Perl guru";
new_s = s.replace("Perl", "Python");

i always had trouble doing this in perl- just worked around it- then
realized that this shouldn't be hard when reading your post... so i
played...
$s = "I am Perl guru";
$new_s = ($s =~ s/erl/ython/);
print "$s \t $new_s \n";  #oops!  Prints  I am a Python guru
1"
#but
($new_s = $s) =~ s/erl/ython/;
print "$s \t $new_s \n";  

#prints   I am a Perl guru  I am a Python guru
Perl can be surprisingly intuitive-  using precedence rules to get this
done makes good sense to me :)


Huh? Remark, no addition modules.

*shrug*  eh- go figure

willy
http://www.hackswell.com/corenth
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



substitution and assignment fun ( was RE: Becoming Disenheartened )

2004-10-01 Thread West, William M


>
>Python and Ruby don't write the code for me. But look at this Python
code:
>
>s = "I am Perl guru";
>new_s = s.replace("Perl", "Python");


i always had trouble doing this in perl- just worked around it- then
realized that this shouldn't be hard when reading your post... so i
played...

$s = "I am Perl guru";

$new_s = ($s =~ s/erl/ython/);

print "$s \t $new_s \n";  #oops!  PrintsI am a Python guru
1"

#but

($new_s = $s) =~ s/erl/ython/;
print "$s \t $new_s \n";  

#prints   I am a Perl guru  I am a Python guru


Perl can be surprisingly intuitive-  using precedence rules to get this
done makes good sense to me :)




>Huh? Remark, no addition modules.


*shrug*  eh- go figure



willy
http://www.hackswell.com/corenth

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]