68 lines
931 B
V
68 lines
931 B
V
import math { max, min }
|
|
import cli { Command }
|
|
import math.complex { Complex, complex }
|
|
import os {
|
|
file_ext,
|
|
user_os,
|
|
}
|
|
import mod {
|
|
Enum,
|
|
FnArg,
|
|
FnRet,
|
|
InterfaceField,
|
|
InterfaceMethodArg,
|
|
InterfaceMethodRet,
|
|
RightOfAs,
|
|
RightOfIs,
|
|
StructEmbed,
|
|
StructField,
|
|
StructMethodArg,
|
|
StructMethodRet,
|
|
StructRefField,
|
|
}
|
|
|
|
struct Struct {
|
|
StructEmbed
|
|
v StructField
|
|
ref &StructRefField
|
|
}
|
|
|
|
fn (s Struct) method(v StructMethodArg) StructMethodRet {
|
|
return StructMethodRet{}
|
|
}
|
|
|
|
interface Interface {
|
|
v InterfaceField
|
|
f(InterfaceMethodArg) InterfaceMethodRet
|
|
}
|
|
|
|
fn f(v FnArg) FnRet {
|
|
if v is RightOfIs {
|
|
}
|
|
_ = v as RightOfAs
|
|
|
|
println(Enum.val)
|
|
|
|
return FnRet{}
|
|
}
|
|
|
|
struct App {
|
|
command &Command
|
|
}
|
|
|
|
struct MyCommand {
|
|
Command
|
|
}
|
|
|
|
fn imaginary(im f64) Complex {
|
|
return complex(0, im)
|
|
}
|
|
|
|
fn main() {
|
|
println(max(0.1, 0.2))
|
|
println(min(0.1, 0.2))
|
|
println(user_os())
|
|
println(file_ext('main.v'))
|
|
println(imaginary(1))
|
|
}
|