Need variable to be constant on runtime without initialization at declaring

2022-02-28 Thread juancarlospaco
That can be one-liner too.

Need variable to be constant on runtime without initialization at declaring

2022-02-28 Thread ynfle
I find it considerably more readable and less error prone to do let n = if u > 7: 3 else: 1 Run

Need variable to be constant on runtime without initialization at declaring

2022-02-28 Thread PMunch
Nims syntax is quite flexible with this. For more details you can check out this:

Need variable to be constant on runtime without initialization at declaring

2022-02-28 Thread mardiyah
So sorry, I recklessly post without trying out works great then, thanks!

Need variable to be constant on runtime without initialization at declaring

2022-02-28 Thread mardiyah
Please show clear syntax how to be multi line after `:` of both if, else

Need variable to be constant on runtime without initialization at declaring

2022-02-28 Thread enthus1ast
What do you mean? This is the syntax.

Need variable to be constant on runtime without initialization at declaring

2022-02-28 Thread enthus1ast
You can do it like this let n = if u > 7: 3 else: 1 Run

Need variable to be constant on runtime without initialization at declaring

2022-02-28 Thread mardiyah
How make a variable to be constant on runtime if cannot have had initializing value unless later on in another scope block? e.g. illustration is u : int # ... let n= # can't afford RHS due to obeying next condition but n must be safe... #...