h3rald / min

A small but practical concatenative programming language and shell
https://min-lang.org
MIT License
311 stars 23 forks source link

`load` conflicts with `cd` #26

Closed mwgkgk closed 6 years ago

mwgkgk commented 6 years ago

To reproduce:

root/file1.min

"File 1 loaded!" puts!

root/dir1/file2.min


("file2.min" file?) (args first dirname cd) unless

"../file1" load

Error scenario:

min root/dir1/file2.min (!) root/dir1/file2.min(3,15) [load]: File 'root/dir1/../file1.min' does not exists. root/dir1/file2.min(3,15) in symbol: load


No problems when run without cd, from the exact dir like the code above suggests, or, without the "unless" line, from anywhere. It's the cd that messes it up. `fread`, `fappend`, `fwrite`, and even `read` (!!) don't conflict with cd under this scenario.

Error message typo: "does not exists" should be "does not exist".

Like always, big fan of this project. :1st_place_medal: 
h3rald commented 6 years ago

Very strange. I'll investigate and fix it...

Thanks for your input, as usual! :)