odin-lang / odin-lang.org

http://odin-lang.org
22 stars 81 forks source link

#load_or example is compile error, change to #load(path) or_else (proposed solution provided) #164

Closed mahSource closed 6 months ago

mahSource commented 7 months ago

Link to Issue Item

https://odin-lang.org/docs/overview/#load_orstring-path-default

Issue in Short

Change This in the Overview From

"#load_or(, default)" Returns a []u8 of file contents at compile time, otherwise default content when the file wasn’t found.

foo := #load_or("path/to/file", []u8 { 104, 105 })
fmt.println(string(foo))

Change the Overview to This

"#load(path) or_else default" Returns a []u8 of file contents at compile time, otherwise default content when the file wasn’t found.


foo := #load("path/to/file" or_else ([]u8 {104, 105 })
fmt.println(string(foo))