mirror of
https://github.com/Dummi26/mers.git
synced 2025-03-10 14:13:52 +01:00

left side of assignments can now be various different things instead of just variables. any statement that returns a reference can be used to assign to the value behind that reference. variables are automatically referenced, so the '&' can be omitted. if the variable contains a reference and that reference should be used, dereference it with *varname instead of just varname.
18 lines
473 B
Plaintext
18 lines
473 B
Plaintext
lib mers_libs/http_requests
|
|
|
|
t = thread(() {
|
|
// because this downloads for so long, the println() will appear after the other one.
|
|
http_get("https:\//raw.githubusercontent.com/dwyl/english-words/master/words.txt").assume_no_enum()
|
|
println("got words from word list!")
|
|
})
|
|
|
|
sleep(0.5)
|
|
|
|
// this will finish before the thread does.
|
|
http_get("https:\//github.com/").assume_no_enum()
|
|
println("got github start page as html")
|
|
|
|
t.await()
|
|
|
|
http_get("not a url").debug()
|