durexforth icon indicating copy to clipboard operation
durexforth copied to clipboard

LOADB/SAVEB woes

Open jkotlinski opened this issue 2 years ago • 9 comments

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 avatar Dec 27 '22 09:12 jkotlinski

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...

jkotlinski avatar Dec 28 '22 09:12 jkotlinski

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

Whammo avatar Dec 29 '22 07:12 Whammo

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...

jkotlinski avatar Jan 12 '23 00:01 jkotlinski

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

Whammo avatar Jan 13 '23 06:01 Whammo

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?

ekipan avatar Apr 20 '23 00:04 ekipan

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

jkotlinski avatar Apr 20 '23 16:04 jkotlinski

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

jkotlinski avatar Apr 28 '23 06:04 jkotlinski

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

jkotlinski avatar Apr 28 '23 22:04 jkotlinski

v Likes things a certain way.

Whammo avatar Apr 28 '23 23:04 Whammo