Table of Contents [hide]
"Named Value" versus "Variable" ∞
The term most commonly used for this sort of thing is "variable". I keep using that by habit, even though it's not correct with Mythryl.
I don't yet understand things well enough to explain it. =)
Numbers ∞
We can assign a decimal like this.
number = 1; printf "%d\n" number; # => # 1
I like to add space after naming a value. I find it makes the code less cramped.
Strings ∞
Strings work the same way.
string = "Hello, world!\n"; printf "%s" string; # => # Hello, world!
Notice how I put the \n
in the 'string' named value. It can go either there or within the printf
directly, like this:
string = "Hello, world!"; printf "%s\n" string; # => # Hello, world!
Both ∞
number = 42; string = "is The Meaning of Life, The Universe and Everything."; printf "%d %s" number string; # => # 42 is The Meaning of Life, The Universe and Everything.
Last updated 2017-11-19 at 02:53:33