Post
Topic
Board Speculation
Re: Wall Observer BTC/USD - Bitcoin price movement tracking & discussion
by
Gyrsur
on 15/03/2021, 21:35:00 UTC
Quote
1 BTC = 1 BTC

or is it

Quote
1 BTC == 1 BTC
?

technically the first statement is not a boolean.

but the second statement is TRUE .  Grin

..but if you comparejavascript:void(0); strings you have to use quotes Smiley

Quote
"1 BTC" == "1 BTC"

Put this way,

"1 BTC" = "1 BTC"

would just raise an error, right?



Well I guess a variable of "1 BTC" could recursively store itself and then lead to an "OutOfMemory" situation. Smiley

hmm, i doubt so. It's an (anonymous) string literal, which should be read-only (const).
But i got the joke and i like it Cheesy Cheesy
Are there "named variables" in this manner in any language you are aware of?
There are quite some freaky languages out there, like the famous INTERCAL


here you go.

Code:
fn main() {
    let _a = "1 BTC";
    let _b = "1 BTC";
   
    println!("1 BTC = 1 BTC -> {}", _a = _b);
    println!("1 BTC == 1 BTC -> {}", _a == _b);
}

1 BTC = 1 BTC -> 1 BTC
1 BTC == 1 BTC -> true