nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
model: intro `MModule::first_real_mmodule` to get the first non-fictive module
[nit.git]
/
examples
/
fibonacci.nit
diff --git
a/examples/fibonacci.nit
b/examples/fibonacci.nit
index
0df0209
..
e1a72c9
100644
(file)
--- a/
examples/fibonacci.nit
+++ b/
examples/fibonacci.nit
@@
-15,11
+15,11
@@
# limitations under the License.
# A simple exemple of refinement where a method is added to the integer class.
# limitations under the License.
# A simple exemple of refinement where a method is added to the integer class.
-package fibonacci
+module fibonacci
redef class Int
# Calculate the self-th element of the fibonacci sequence.
redef class Int
# Calculate the self-th element of the fibonacci sequence.
- meth fibonacci: Int
+ fun fibonacci: Int
do
if self < 2 then
return 1
do
if self < 2 then
return 1
@@
-30,7
+30,7
@@
redef class Int
end
# Print usage and exit.
end
# Print usage and exit.
-meth usage
+fun usage
do
print "Usage: fibonnaci <integer>"
exit 0
do
print "Usage: fibonnaci <integer>"
exit 0