newRPL - build 1001 released! [update:build 1052]
03-05-2018, 03:15 AM
Post: #161
 Claudio L. Senior Member Posts: 1,220 Joined: Dec 2013
RE: newRPL - build 1001 released! [update:build 1046]
(03-04-2018 10:09 PM)The Shadow Wrote:  I can think of refinements for both of these, though I'm not sure how practical they are to code:

a) Have LIBRCL take three arguments instead of two. The third one is a default value - if the recall fails, the default gets both returned and LIBSTO'd.

b) Instead of, or in addition to, $HANDLER, there is$DEFAULTS. This is a simple list of names and content, which are to be stored into the directory when the library is attached. There might also be a command LIBDEF which would restore the directory to the default values in case things get borked up.

I personally think that either version of b) is more elegant, provided there's a way to re-run the $HANDLER or restore the$DEFAULTS. Otherwise, programmers will effectively have to implement a) anyway.

I like a) but not as an addition to LIBRCL (BTW, LIBRCL takes a single argument, just like RCL), I think LIBDEFRCL is a more appropriate name (actually, a DEFRCL command should probably exist too as a general purpose RCL that provides a default). This way, the developer still has the option with LIBRCL of detecting the missing data (with IFERR) and doing something other than provide a default, while LIBDEFRCL will simply provide a default, which is a simple solution for 99% of cases. I don't think it should store this default, after all it will always default to this value anyway, so why waste storage.
The advantage of a) vs. b) is that a) works well when there was partial data loss or corruption. What doesn't convince me about b) (or the $HANDLER idea altogether) is that if data gets lost arbitrarily, it doesn't automatically repair it. The user would need to reinstall the library or reset it completely, losing all those settings instead of just the few that got damaged. Also, I like that LIBCLEAR works well with LIBDEFRCL, since it will reset to default values by simply cleaning up the directory. Regarding$DEFAULTS, I think individual values using LIBDEFRCL would work better than having a lot of default values in one large list.
Besides, you'd have to have LIBCLEAR also store the \$DEFAULTS, or a different command to store the defaults. But then using LIBCLEAR would leave libraries in a non-working state, until new defaults are stored.
I don't like that "gap", so I'll go for LIBDEFRCL as the best solution.
Thanks for the idea!
03-05-2018, 07:08 PM
Post: #162
 The Shadow Member Posts: 130 Joined: Jan 2014
RE: newRPL - build 1001 released! [update:build 1046]
Claudio, glad you like it. I for one will prefer LIBDEFRCL to IFERR loops, and you're right, it'll handle the vast majority of cases.

As for the arguments, I guess I had LIBSTO on the brain.
03-05-2018, 07:30 PM
Post: #163
 Claudio L. Senior Member Posts: 1,220 Joined: Dec 2013
RE: newRPL - build 1001 released! [update:build 1046]
(03-05-2018 07:08 PM)The Shadow Wrote:  Claudio, glad you like it. I for one will prefer LIBDEFRCL to IFERR loops, and you're right, it'll handle the vast majority of cases.

As for the arguments, I guess I had LIBSTO on the brain.

I fixed the issue you mentioned with names becoming garbled. I also added LIBDEFRCL and... the weekend was over before I could finish the autocomplete. As soon as I get that finished I'll update all ROMs.
03-05-2018, 10:05 PM
Post: #164
 The Shadow Member Posts: 130 Joined: Jan 2014
RE: newRPL - build 1001 released! [update:build 1046]
Also, LIBCLEAR doesn't seem to work on a library that has been DETACH'd.
03-05-2018, 10:20 PM
Post: #165
 The Shadow Member Posts: 130 Joined: Jan 2014
RE: newRPL - build 1001 released! [update:build 1046]
What's the syntax on LIBDEFRCL? Does the default come before or after the variable name? I'm trying to get ready.
03-06-2018, 04:53 PM (This post was last modified: 03-06-2018 05:07 PM by Claudio L..)
Post: #166
 Claudio L. Senior Member Posts: 1,220 Joined: Dec 2013
RE: newRPL - build 1001 released! [update:build 1046]
(03-05-2018 10:20 PM)The Shadow Wrote:  What's the syntax on LIBDEFRCL? Does the default come before or after the variable name? I'm trying to get ready.

DefObject 'Name' LIBDEFRCL

EDIT: Libs were updated to build 1052 with all of the above.
03-07-2018, 08:25 AM
Post: #167
 The Shadow Member Posts: 130 Joined: Jan 2014
RE: newRPL - build 1001 released! [update:build 1052]
I've made several libraries now, and there seem to be bugs in CRLIB. After extensive experimentation, I think the problem lies in visible commands that reference other visible commands in the same library. Such programs often seem to fail in freakish ways... Multiple things can be put on the stack, sometimes things from the library directory that were created by other programs entirely.
03-07-2018, 03:15 PM
Post: #168
 Claudio L. Senior Member Posts: 1,220 Joined: Dec 2013
RE: newRPL - build 1001 released! [update:build 1052]
(03-07-2018 08:25 AM)The Shadow Wrote:  I've made several libraries now, and there seem to be bugs in CRLIB. After extensive experimentation, I think the problem lies in visible commands that reference other visible commands in the same library. Such programs often seem to fail in freakish ways... Multiple things can be put on the stack, sometimes things from the library directory that were created by other programs entirely.

Please email me a failing example and I'll investigate. Is it still failing after rebuilding the libraries with the latest ROM?
CRLIB does a very delicate, surgical job of re-coding your programs replacing the IDENTs you use in the directory with LIBPTR objects that call the code inside the library. I have made several simple tests to check specific cases and couldn't make it fail, so I need your help in providing code that fails.
03-07-2018, 05:11 PM
Post: #169
 The Shadow Member Posts: 130 Joined: Jan 2014
RE: newRPL - build 1001 released! [update:build 1052]
Claudio,

Library sent. And yes, I compiled it multiple times with the latest ROM.
03-09-2018, 04:17 PM
Post: #170
 Claudio L. Senior Member Posts: 1,220 Joined: Dec 2013
RE: newRPL - build 1001 released! [update:build 1052]
(03-07-2018 05:11 PM)The Shadow Wrote:  Claudio,

Library sent. And yes, I compiled it multiple times with the latest ROM.

Found the bug and fixed it (all roms were updated to 1055). Turns out the ignore list was counting wrong, and the library object total size was miscalculated, trimming off the last 2 commands of the last program in the library (XDOT), the last command being the end of the secondary, so it kept executing other random objects in memory after the program ended. All fixed now.
03-09-2018, 04:43 PM
Post: #171
 The Shadow Member Posts: 130 Joined: Jan 2014
RE: newRPL - build 1001 released! [update:build 1052]
You're a marvel, Claudio! I'll try building again.

Back to solvers, forms, and the plotting engine, then? Not necessarily in that order?
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)