RPL comment syntax
|
08-26-2023, 11:49 PM
Post: #1
|
|||
|
|||
RPL comment syntax
I am in the process of implementing comments for DB48X, and I am wondering about the best way to deal with them.
There seems to be a wide consensus that comments in RPL begin with @ and end with a newline. This is exemplified with code found on the Wikipedia page about RPL, which has examples like this: Code: « Notice that the comments are aligned on the right. That also seems to be a rather common style for RPL comments. Now, I see several ways to approach comments on DB48X: 1/ Parse them, but ignore them. In other words, the comments are not kept in the object, and if you edit, you won't see them. That makes sense if you edit your files on a PC to be consumed by the calculator. 2/ To have a "comment" object type, which preserves a comment in the source code, and has no effect during execution. That seems more useful on a calculator, but has the problem that RPL compiles objects, so you need a nice way to render comments. That's where the style above is a bit problematic. While it looks nice on a PC screen, it's next to unusable on the calculator screen, for two reasons: a) being on the right, they are rarely visible along with the code. b) keeping the comments nicely aligned adds a lot of complexity to the editor code. So I would like to know how you feel about the following approaches 1) Have two types of comments, one being removed at parse time, the other being preserved. I'm thinking that comments beginning with @ could be preserved and comments beginning with $ or maybe @@ would be eliminated. 2) Change the "standard" style for RPL programs where comments would be on a line on their own, aligned with the code. This is what my code decompiler produces at the moment: Code:
Does that sound like an acceptable trade-off? |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
RPL comment syntax - c3d - 08-26-2023 11:49 PM
RE: RPL comment syntax - Raymond Del Tondo - 08-27-2023, 01:03 AM
RE: RPL comment syntax - rprosperi - 08-27-2023, 01:29 AM
RE: RPL comment syntax - Claudio L. - 08-27-2023, 03:56 AM
RE: RPL comment syntax - c3d - 08-27-2023, 06:45 AM
RE: RPL comment syntax - rprosperi - 08-27-2023, 12:08 PM
RE: RPL comment syntax - John Keith - 08-27-2023, 04:34 PM
RE: RPL comment syntax - Gilles - 08-27-2023, 08:34 AM
RE: RPL comment syntax - c3d - 08-27-2023, 11:05 AM
RE: RPL comment syntax - John Keith - 08-27-2023, 04:19 PM
RE: RPL comment syntax - Helix - 08-27-2023, 11:00 AM
RE: RPL comment syntax - BruceH - 08-27-2023, 05:13 PM
|
User(s) browsing this thread: 2 Guest(s)