What is script mode in V #26040
-
|
Either __global (it's about how to enable global mode in V), an assignment out-scope function the compiler switching to a script mode such reported by the compiler itself when running the program, i need help about this an explanation what is script mode in V or give me a link to another resource in the internet, thank you for help. module main
a := 10
fn main_a() {
a := 10
println('Hello World!')
}
fn main_b() {
a := 10
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
It simply means V without the "fluff". Script mode automatically imports the That's how you can have println('Hello World')as a complete V program. No This is actually implemented in such a way that V wraps a "virtual" |
Beta Was this translation helpful? Give feedback.
It is a very explicit error, which is happening because you have
a := 10before the function definitions. In script mode, all functions, structs, etc. must occur before the first "code" (which in this case is just declaring a variable.Your example:
gives the following:
while just moving t…