Programming Pad for RPL Programs
|
05-21-2014, 11:45 PM
Post: #21
|
|||
|
|||
RE: Programming Pad for RPL Programs
(05-21-2014 09:03 PM)Raymond Del Tondo Wrote: Hi, Thanks Ray! The pointer to your post in that thread is the sample code I have been looking for. I recalled the general format, but not when/who by/where I had seen it. Similar to the style Thomas also suggested, but I see you have the stack bottom to the left as well. Who knows, perhaps my instincts were really just partially recalling your example. Anyhow thanks for these notes. I think I'm going to check out Debug4X as I have no current IDE or strong editor preference to drive any particular solution. If Debug4X is a fully integrated suite, I may as well learn that tool. I generally use TextPad and had given thought to creating language templates for RPL, but for SysRPL, the vocabulary is so large it's not practical. --Bob Prosperi |
|||
05-22-2014, 01:38 AM
Post: #22
|
|||
|
|||
RE: Programming Pad for RPL Programs
(05-21-2014 11:23 PM)rprosperi Wrote: Thanks Thomas, interesting style. And I'm sure you're damned happy to see such excellent comments when you come back to look at this code months (even hours!) later. In this particular case I've added the stack diagrams to analyze the program. Quote:I think I might have had the stack reversed (left-to-right vs. your right-to-left), so that the 'bottom' level is at the left side near the current command, so you can always see the most immediate argument you are working with. That's just the way stack-diagrams are written in FORTH. Though I can see your point it would be tedious to reverse the stack and have it right-aligned. I think it's helpful when elements of the stack that aren't affected by a command stay at the same position. You could write the stack-diagram on the left of your code but then you'll see the result before you see the action. After a while you just get used to it. Cheers Thomas |
|||
05-22-2014, 09:05 AM
Post: #23
|
|||
|
|||
RE: Programming Pad for RPL Programs
(05-22-2014 01:38 AM)Thomas Klemm Wrote: Though I can see your point it would be tedious to reverse the stack and have it right-aligned.The order of arguments and outputs in a stack diagram is a convention. All RPL related HP documents (manuals, external, internal) since the HP-28C use the right aligned order, and thus using this order simply avoids problems when reading stack diagrams from different sources. Also all somewhat bigger projects, like RPL48, JAZZ, Java, and of course SpeedUI use the principal HP convention for stack diagrams. (05-22-2014 01:38 AM)Thomas Klemm Wrote: I think it's helpful when elements of the stack that aren't affected by a command stay at the same position.But they don't stay at the same position. If a command takes four arguments and returns nothing, the elements above (or below) the 4 args are on top of the stack after the command. -- Ray |
|||
05-22-2014, 10:12 AM
Post: #24
|
|||
|
|||
RE: Programming Pad for RPL Programs
(05-22-2014 09:05 AM)Raymond Del Tondo Wrote:(05-22-2014 01:38 AM)Thomas Klemm Wrote: Though I can see your point it would be tedious to reverse the stack and have it right-aligned.The order of arguments and outputs in a stack diagram is a convention. All RPL related HP documents (manuals, external, internal) since the HP-28C use the right aligned order, and thus using this order simply avoids problems when reading stack diagrams from different sources. Now I'm confused. This code snippet is from the source you mentioned: Code: DUP ROT SWAP ( *A 2xDim B 2xDim* ) Do you agree that this stack diagram is left-aligned (linksbündig)? And this stack diagram bellow is reversed and right-aligned: Code: DUP ROT SWAP ( *2xDim B 2xDim A* ) This is the order that rprosperi prefers. Quote:(05-22-2014 01:38 AM)Thomas Klemm Wrote: I think it's helpful when elements of the stack that aren't affected by a command stay at the same position.But they don't stay at the same position. If a command takes four arguments and returns nothing, the elements above (or below) the 4 args are on top of the stack after the command. Code: ( a b c d e f ) Best regards Thomas |
|||
05-22-2014, 11:44 AM
Post: #25
|
|||
|
|||
RE: Programming Pad for RPL Programs
(05-22-2014 10:12 AM)Thomas Klemm Wrote: Now I'm confused. This code snippet is from the source you mentioned:So maybe there was a misinterpretation on my side;-) I set order synonymous to alignment. Actually the alignment (not the order) is _left_ in most cases. And even in the 2nd example the comments are left-aligned, but due to the proportional font the alignments got lost. This is why I strongly suggest using an editor/viewer with monospaced font. Normally I use tabs to align the comments in my editor, but this doesn't work well in the MyBB editor. Sorry for the confusion:-) -- Ray |
|||
05-22-2014, 01:14 PM
Post: #26
|
|||
|
|||
RE: Programming Pad for RPL Programs
In reply to the last several comments, I caused some confusion as I was not as precise as I should have been in my earlier post; sorry for that.
I prefer left-aligned stack elements containing stack bottom-to-top levels in left-to-right order. I beleive this is what Ray has been showing, and I must confess my bias is almost certainly influenced by the stuff in the HP manauls, though I frankly didn't recall they used that style. I guess 20 years of exposure has had some impact, even if I don't recall it... And its damned odd that the same 20 years exposure to some comments from my wife had had far less effect, but I do recall those. Hmm.... --Bob Prosperi |
|||
05-22-2014, 01:30 PM
Post: #27
|
|||
|
|||
RE: Programming Pad for RPL Programs
Quote:manche meinen- Ernst Jandl, lichtung |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)