asoffer / Icarus

An experimental general-purpose programming language
Apache License 2.0
9 stars 2 forks source link

Misc. stdlib improvements #60

Closed perimosocordiae closed 3 years ago

perimosocordiae commented 3 years ago

The main contribution here is the file.Lines scope, which makes it easy to iterate over the lines of a file. I also did some cleanup of the core.for scope, which no longer requires exporting its state struct.

Known issues:

file.WithLines("foo.txt") each [line: []char] {
  // operate on line
} error [e: errno.error] {
  // handle file open/read errors
}