jkotlinski / durexforth

Modern C64 Forth
Other
230 stars 28 forks source link

LOADB/SAVEB woes #500

Open jkotlinski opened 1 year ago

jkotlinski commented 1 year ago

Back in 2009, LOADB/SAVEB got their names because "LOAD" was already in use.

Since "LOAD" is now unused, I think it would make sense to rename "LOADB"/"SAVEB" to simply "LOAD"/"SAVE" (or, possibly, "LOAD-FILE"/"SAVE-FILE").

jkotlinski commented 1 year ago

On more thought. Maybe "LOAD" is not that great, it is normally used for Block loading, so there is some risk of conflict or confusion.

SuperForth64 uses "LOADRAM" and "SAVENAME + SAVE".

ultraFORTH83 uses "BLOAD"/"BSAVE".

More investigation to follow...

Whammo commented 1 year ago

Something Unix-ish, like maybe READ WRITE. Jonesforth was no help.

jkotlinski commented 1 year ago

I like LOAD-FILE/SAVE-FILE best, because this naming is similar to Forth Standard words (OPEN-FILE, CLOSE-FILE, ...) but it is unclear if it is worth a breaking change...

Whammo commented 1 year ago

Maybe they should be hidden and we can offer LOAD and SAVE in io.fs?

ekipan commented 1 year ago

Something Unix-ish, like maybe READ WRITE.

If I understand correctly, unlike standard read-file and write-file, loadb and saveb do the whole file instead of following a seek pointer (Edit: so these names are probably not the best).

Does the "binary data" mentioned in the manual mean "PRG file" (another thing I don't know about)? If so how about load-prg and save-prg?

jkotlinski commented 1 year ago

I think "binary data" is nonsense, you are right in that it reads whole .prg files. Maybe load-prg/save-prg is good.

jkotlinski commented 1 year ago

Another gripe about saveb. The range is given as start address + end address. In Forth, it is nearly always start address + length.

jkotlinski commented 1 year ago

Yet another confusing thing... loadb takes first filename, then data address. saveb takes first data address, then filename. It is set up for mistakes.

Whammo commented 1 year ago

v Likes things a certain way.