[ nice-Bugs-874594 ] local methods ()
"SourceForge.net" <[email protected]>
| Newsgroups | gmane.comp.lang.nice.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #874594, was opened at 2004-01-10 12:23
Message generated for change (Comment added) made by igouy
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=874594&group_id=12788
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Isaac Gouy (igouy)
Assigned to: Nobody/Anonymous (nobody)
Summary: local methods ()
Initial Comment:
void main(String[] args){
void f1(){ println("f1"); }
void f2(){ println("f2"); }
f1();
f2;
println("Again!");
f1;
f2();
}
\Nice\Test>java -jar t.jar
f1
Again!
f2
Nice compiler version 0.9.6 prerelease (build 2004.01.10,
17:42:12 UTC)
----------------------------------------------------------------------
>Comment By: Isaac Gouy (igouy)
Date: 2004-01-10 19:30
Message:
Logged In: YES
user_id=536291
(I guess the example I gave was module functions not local
functions, although the same thing happens with functions
that are local to a method.)
Yes, there seems to be some interface between having 'first
class functions' and allowing the convenience of not needing
() for a method invocation.
If
int f() = 5;
int i = f;
then how would we assign the function to a variable?
void->int fun = f;
Of course, the same thing crops up for calls to Java static
methods:
import java.text.*;
void main(String[] args){
let m = NumberFormat.getAvailableLocales;
println(m);
}
I like the convenience of not needing to use () but I like
consistency more. It would be nice if the way a function was
invoked was clearly different from the way a functional was
referenced. (Maybe I just don't understand how to do that.)
----------------------------------------------------------------------
Comment By: Arjan Boeijink (arjanb)
Date: 2004-01-10 15:59
Message:
Logged In: YES
user_id=688815
This is a bug but i'm not sure whether this code should just
work or throw an error/warning becauce the () are missing.
When leaving () away is possible and what it means should be
discussed because the exact rules for this are not known and
I don't think the current implementation is consistent.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=874594&group_id=12788
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html