User loginNavigation |
I'm from china and I'm working on a new programming language "Zero"First appologize for my poor English.:)So,I just write more codes. I'v found a new way of reusing codes: Question:
How to write a function return all these propX's value?
these three functions are very similar,can we write one function to deal with it? In my new programming language "Zero",it is OK!
So strange!Can it work?How to use it?Can the compiler of the language deal with it? Zero language has an IDE named "Amoeba".Through the syntax of the function analysis, Amoeba knows: so,when we write the function in IDE:
There is a blank we should fill.Amoeba's Code assist will give the message: It means there is only one selection we can fill.Why? Because m1 is integer type,and each side of ":=" has the same type,"Amoeba" knows it. if the code is like this:
Amoeba's Code assist will give the message: Why?because Amoeba don't know m1's type.So there are 3 selections. Now m1 has a "float" type! Let's explain the new way of reusing codes,the rule is: If we found similar codes,write it directly,if something is By guy_from_china at 2009-01-30 14:58 | LtU Forum | previous forum topic | next forum topic | other blogs | 5935 reads
|
Browse archives
Active forum topics |
Recent comments
22 weeks 6 days ago
22 weeks 6 days ago
22 weeks 6 days ago
45 weeks 19 hours ago
49 weeks 2 days ago
50 weeks 6 days ago
50 weeks 6 days ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago