Cleaned up example code and made it up-to-date
This commit is contained in:
parent
61819311e9
commit
ca80a5968d
@ -1,3 +1,9 @@
|
|||||||
:arf
|
:arf
|
||||||
|
require "io"
|
||||||
|
---
|
||||||
|
|
||||||
func rr main
|
func ro main
|
||||||
|
> arguments:{String}
|
||||||
|
< status:Int 0
|
||||||
|
---
|
||||||
|
io.println "hello world"
|
||||||
|
@ -5,35 +5,29 @@ require "io"
|
|||||||
---
|
---
|
||||||
|
|
||||||
# this is a global variable
|
# this is a global variable
|
||||||
data wn helloText:String "Hello, world!"
|
data pv helloText:String "Hello, world!"
|
||||||
|
|
||||||
# this is a struct definition
|
# this is a struct definition
|
||||||
type rr Greeter:Obj
|
objt ro Greeter:Obj
|
||||||
# "Hi." is a string constant. all Greeters will be initialized with a
|
|
||||||
# pointer to it. I don't know really it depends on what I decide that
|
|
||||||
# a String type even is.
|
|
||||||
wr text:String "Hi."
|
wr text:String "Hi."
|
||||||
"sdfdsf" "ahh"
|
|
||||||
"asdf"
|
|
||||||
|
|
||||||
# this is a function
|
# this is a function
|
||||||
func rr main
|
func ro main
|
||||||
> argc:Int
|
> arguments:{String}
|
||||||
> argv:{String}
|
|
||||||
< status:Int 0
|
< status:Int 0
|
||||||
---
|
---
|
||||||
let greeter:Greeter:mut
|
set greeter:Greeter:mut
|
||||||
greeter.setText helloText
|
greeter.setText helloText
|
||||||
greeter.greet
|
greeter.greet
|
||||||
|
|
||||||
# this is a member function
|
# this is a member function
|
||||||
func rr greet
|
func ro greet
|
||||||
@ greeter:{Greeter}
|
@ greeter:{Greeter}
|
||||||
---
|
---
|
||||||
io.println greeter.text
|
io.println greeter.text
|
||||||
|
|
||||||
# this is mutator member function
|
# this is mutator member function
|
||||||
func rr setText
|
func ro setText
|
||||||
@ greeter:{Greeter}
|
@ greeter:{Greeter}
|
||||||
> text:String
|
> text:String
|
||||||
---
|
---
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
:arf
|
|
||||||
require io
|
|
||||||
---
|
|
||||||
|
|
||||||
func rr main
|
|
||||||
> argc:Int
|
|
||||||
> argv:{String}
|
|
||||||
< status:Int
|
|
||||||
---
|
|
||||||
io.println [io.readln]
|
|
||||||
= status 0
|
|
@ -1,13 +0,0 @@
|
|||||||
:arf
|
|
||||||
---
|
|
||||||
|
|
||||||
data:{Int 6}
|
|
||||||
-39480 398 29 0x3AFe3 0b10001010110 0o666
|
|
||||||
|
|
||||||
func rr literals
|
|
||||||
---
|
|
||||||
= stringLiteral:String "skadjlsakdj"
|
|
||||||
= intArrayLiteral:{Int 3} 2398
|
|
||||||
-2938 324
|
|
||||||
= runeLiteral:Rune 'a'
|
|
||||||
= floatArrayLiteral:{F64 5} 3248.23 0.324 -94.29
|
|
Reference in New Issue
Block a user