develooper Front page | perl.perl6.language | Postings from July 2005

Re: method calls on $self

Thread Previous | Thread Next
From:
Stevan Little
Date:
July 8, 2005 07:08
Subject:
Re: method calls on $self
Message ID:
c7b6f97762c809243dc93b3b4e212353@iinteractive.com

On Jul 8, 2005, at 2:10 AM, Robin Redeker wrote:
> And what will be the default syntax to call
> a method on self? If everyone has completly other
> preferences about this, for example this horrible ./method()
> syntax, which completly wont fit into the language, whose
> favorite will be the default?
> None at all?
> An explicit call, like $?SELF.method () ?

I have never understood what is wrong with this:

method foo ($self: $bar) {
	$self.baz()
}

Then you can easily so whatever you like:

## for our Java inclined friends
method foo ($this: $bar) {
	$this.baz()
}

method foo  
($my_completly_custom_syntax_and_grammar_which_has_nothing_to_do_with_pe 
rl6_anymore: $bar) {
	 
$my_completly_custom_syntax_and_grammar_which_has_nothing_to_do_with_per 
l6_anymore.baz()
}

method foo ($o: $bar) {
	$o.baz()
}

Why does it have to be some sugared syntax when you can just simple  
name it in the parameter list?

Stevan


>
> Will we end in something like
>
> use
> my_completly_custom_syntax_and_grammar_which_has_nothing_to_do_with_per 
> l6_anymore;
>
> ?
>
>
> thanks,
> Robin
>
> -- 
> elmex@x-paste.de / robin@nethype.de
> Robin Redeker
>


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