My wishes about NEW-RPL
|
09-30-2016, 03:16 AM
(This post was last modified: 09-30-2016 08:19 PM by compsystems.)
Post: #1
|
|||
|
|||
My wishes about NEW-RPL
sorry for my bad English =[
Hi, HP-RPL users and RPN lovers, Please comment on each point exposed I have not tried yet NEWRPL because I have not a hp50real and the NewRPL-DEMO app for windows not have a keyboard =( these suggestions are based on what has the hp 50 and that I would like to see in newRPL or in a future firmware upgrade from HP 1: Use an operator optional as end line, semicolon (; ) for example. Where the program editor can format each sentences, and thus to adjust the code vertically, my HP48/50 programs always the editor adjusted to line the width of the screen and not as I wrote in the source code =( Code: « 'RCUADRATIC' RCL -> Code: « And not Code: « 3 →LIST { A B C } STO B NEG B 2 ^ 4 A * C * - √ + 2 A * / B NEG B 2 ^ 4 A * C * - √ - 2 A * / { A B C } PURGE ; 2: Do not delete comments to store programs Code: «@ inicio de programa 'RCUADRATIC' RCL -> Code: « 3: use a different delimiter between variables & symbolic expression, for example a polynomial 'x^1' -> 'x' would be treated as algebraic expression and non-variable delimiters `` for storage Code: `RCUADRADIC` STO delimiters '' for algebraic expression Code: 'X' STO Code: 'X^1' EVAL TYPE @ returns 6 should return the same data type (9), the solution to the ambiguity of a variable as algrebaica expression is solved with my idea Code:
Hold right key (hp50)+ [''], put the backtick or reverse quotes 4: use "ENDIF" "ENDCASE" "ENDWHILE" "ENDDO" ETC as option to visually and detect the body block, also this allows easier code converters The following code is very difficult to know which end is up to each block when no indentation Code: IF -> Code: IF 5: A flag to maintain always a complex number in format (x, y) dupla (x, y) [ENTER] (x, y) and not x+y*i and not (r, angle theta) 6: a new type of data is needed tripla (x,y,z) for geometric objects 7: Local storage in RPN Code: « == 1 2 3 `A` `B` `C` → @ RPN NOTATION =) Code: « == 1 2 3 → A B C @ infix notation =( |
|||
09-30-2016, 12:22 PM
Post: #2
|
|||
|
|||
RE: My wishes about NEW-RPL
8: Please add the PART function, built-in the system, this function is essential in the handling of algebraic expression
thread http://www.hpmuseum.org/forum/thread-637...light=part Code: « 0 0 { } -> EXPRESSION XPART NPARTS OPERATOR OBJECTS 'sin(x)+cos(x))' -1 → 2 // 2 parts 'sin(x)+cos(x)' 0 → "+" // operator 'sin(x)+cos(x)' 1 → 'sin(x)' // part1 'sin(x)+cos(x)' 2 → 'cos(x)' // part2 'sin(x)+cos(x)' 3 → "nonexistent part in the expression" |
|||
09-30-2016, 04:36 PM
Post: #3
|
|||
|
|||
RE: My wishes about NEW-RPL
Answer refers to the numbers in your first post
1. Sounds interesting 2. is already available: a: @this a volatile comment @ b: @@this is a persistent comment@@ 4. I'd support that 7. is already available, different syntax though: <<1 'A' LSTO 2 'B' LSTO 3 'C' LSTO>> This creates local variables anywhere as you see fit, and these are much faster accessible with LRCL than global variables with RCL. Günter |
|||
09-30-2016, 07:59 PM
Post: #4
|
|||
|
|||
RE: My wishes about NEW-RPL
(09-30-2016 03:16 AM)compsystems Wrote: 1: Use an operator optional as end line, semicolon (; ) for example. Persistent comments also preserve the newline at the end. This means all you have to do to keep it formatted is add a comment at the end: Code:
(09-30-2016 03:16 AM)compsystems Wrote: 2: Do not delete comments to store programs Already explained by Guenter, just use @@ for single line permanent comment. (09-30-2016 03:16 AM)compsystems Wrote: 3: use a different delimiter between variables & symbolic expression, for example a polynomial 'x^1' -> 'x' would be treated as algebraic expression and non-variable It would break compatibility too much. (09-30-2016 03:16 AM)compsystems Wrote: 4: use "ENDIF" "ENDCASE" "ENDWHILE" "ENDDO" ETC as option to visually and detect the body block, also this allows easier code converters This already exists. You can code using ENDIF, ENDCASE, ENDWHILE, ENDDO, and you can also distinguish THEN, THENERR and THENCASE. The code can decompile to either END or all different forms of end. Right now it's set to END and THEN, so even if you code with ENDIF, it will display END when you decompile it. Back when I did this I didn't have flags implemented yet, and then I forgot all about it. I need to find a flag to configure this option. The accepted constructs are: Code:
(09-30-2016 03:16 AM)compsystems Wrote: 5: A flag to maintain always a complex number in format (x, y) dupla This already exists, without any flags. A number stays the way you entered unless you explicitly convert it to other form. (09-30-2016 03:16 AM)compsystems Wrote: 6: a new type of data is needed tripla (x,y,z) for geometric objects ??? Please explain better, I don't understand why you would need a separate type, you can use vectors for that. Complex numbers are not vectors because i^2=-1, (being 'i' considered as the unit vector for the second component of the dupla). This is inconsistent with a standard vector space, hence it needs different rules than a vector. All other nth-uplas are the same. (09-30-2016 03:16 AM)compsystems Wrote: 7: Local storage in RPN This also already exists. |
|||
09-30-2016, 08:45 PM
Post: #5
|
|||
|
|||
RE: My wishes about NEW-RPL
(09-30-2016 03:16 AM)compsystems Wrote: 1: Use an operator optional as end line, semicolon (; ) for example. Persistent comments also preserve the newline at the end. This means all you have to do to keep it formatted is add a comment at the end: Code:
> but if the source code has no comments, the formatting is lost, it is necessary to finalize the "sentences" somehow, the semicolon is best (09-30-2016 03:16 AM)compsystems Wrote: 2: Do not delete comments to store programs Already explained by Guenter, just use @@ for single line permanent comment. >OK (09-30-2016 03:16 AM)compsystems Wrote: 3: use a different delimiter between variables & symbolic expression, for example a polynomial 'x^1' -> 'x' would be treated as algebraic expression and non-variable It would break compatibility too much. >partly yes, but this is a serious in handling algebraic expressions problem, create patches within the code to avoid ambiguity. the idea is to work more naturally, separating variables of algebraic expressions the hp49/hp50 if include this new delimiter, but it is useless because it changes the delimiters try `X^1` EVAL returns 'X' (09-30-2016 03:16 AM)compsystems Wrote: 4: use "ENDIF" "ENDCASE" "ENDWHILE" "ENDDO" ETC as option to visually and detect the body block, also this allows easier code converters This already exists. You can code using ENDIF, ENDCASE, ENDWHILE, ENDDO, and you can also distinguish THEN, THENERR and THENCASE. The code can decompile to either END or all different forms of end. Right now it's set to END and THEN, so even if you code with ENDIF, it will display END when you decompile it. Back when I did this I didn't have flags implemented yet, and then I forgot all about it. I need to find a flag to configure this option. The accepted constructs are: Code:
(09-30-2016 03:16 AM)compsystems Wrote: 5: A flag to maintain always a complex number in format (x, y) dupla This already exists, without any flags. A number stays the way you entered unless you explicitly convert it to other form. > but when the expression is simplificque is preserved? (09-30-2016 03:16 AM)compsystems Wrote: 6: a new type of data is needed tripla (x,y,z) for geometric objects ??? Please explain better, I don't understand why you would need a separate type, you can use vectors for that. Complex numbers are not vectors because i^2=-1, (being 'i' considered as the unit vector for the second component of the dupla). This is inconsistent with a standard vector space, hence it needs different rules than a vector. All other nth-uplas are the same. > for example geogebra has a specific data type to tuple, as a point pairs (x,y) and triples for 3D points (x,y,z), vectors can be used, but the idea is to be more explicit in the source code. compared with hprime that is very difficult to code the lists, in some cases are lists [] -> {} in other vectors [] and other matrices [[]] Threads http://www.hpmuseum.org/forum/thread-6669.html http://www.hpmuseum.org/forum/thread-6628.html (09-30-2016 03:16 AM)compsystems Wrote: 7: Local storage in RPN This also already exists. > OK 8: PART is very important to analyze the input expression in a function, it must be included in the ROM =) Thanks |
|||
10-01-2016, 01:43 PM
Post: #6
|
|||
|
|||
RE: My wishes about NEW-RPL
(09-30-2016 08:45 PM)compsystems Wrote:(09-30-2016 03:16 AM)compsystems Wrote: 1: Use an operator optional as end line, semicolon (; ) for example. Two "@@" preceding the new line do exactly what you want the ";" to do. There is no comment necessary. See above, the @@ following the DUP do the job. Günter |
|||
10-01-2016, 01:54 PM
Post: #7
|
|||
|
|||
RE: My wishes about NEW-RPL
Hello,
although I am not the biggest fan of RPL myself (to put it mildly) I follow these threads with interest. One thing puzzles me and is somehow contradicting my own programming experience: When I add a comment to any piece of program code I usually want it to stay there, i.e. expect it to be a persistent comment. Most of "my" comments are of this type. A temporary comment, e.g. to mark a piece of code which is not finished yet or requires improvement, is rather seldom used. Normally I can remember those tings long enough (yet...). So for me the logical thing to do would be to mark the more often needed comments in the way that requires less keystokes, which would be a single "@". But maybe this is just me? Regards Max |
|||
10-01-2016, 02:02 PM
Post: #8
|
|||
|
|||
RE: My wishes about NEW-RPL
Volatile comments are a great idea. For example if you use an external editor RPL code, and want the comments to be sent to a calculator are lost, we are saving memory=)
|
|||
10-01-2016, 02:05 PM
Post: #9
|
|||
|
|||
RE: My wishes about NEW-RPL
(10-01-2016 01:54 PM)Maximilian Hohmann Wrote: Hello, Legacy RPL doesn't have persistent comments at all. I don't get the usefulness of volatile comments, once the source is compiled they're gone. Perhaps Claudio re-evaluates the nature of the comments, shouldn't be to difficult to have it the other way around. Günter |
|||
10-01-2016, 02:11 PM
(This post was last modified: 10-03-2016 01:42 PM by compsystems.)
Post: #10
|
|||
|
|||
RE: My wishes about NEW-RPL
9: Super idea LISP language (prefix notation with list processing)
Use optional brackets () for operators and functions as dynamic arity By default, the sum binary operator (+) only requires two arguments x y + returns 'x+y' x y z + returns x 'y+z' using parentheses (x y z) + returns 'x+y+z' this is equivalent to using other commands and delimiters {x y z} ∑LIST returns 'x+y+z' It implies that the type of data (x, y) obligatorily requires the comma separator is a tuple Another example (1 2 3) (x y z) + * returns ( 'x+y+z' '2*(x+y+z)' '3*(x+y+z)' ) equivalent to {1 2 3 } {x y z} ∑LIST * returns { 'x+y+z' '2*(x+y+z)' '3*(x+y+z)' } great idea? |
|||
10-01-2016, 02:52 PM
Post: #11
|
|||
|
|||
RE: My wishes about NEW-RPL | |||
10-02-2016, 02:01 AM
Post: #12
|
|||
|
|||
RE: My wishes about NEW-RPL
(10-01-2016 02:52 PM)Maximilian Hohmann Wrote:(10-01-2016 02:02 PM)compsystems Wrote: ...we are saving memory=) if problem, I have a directory in which the source code contains more than 110KB in USER-RPL, included commentary and transferred only contains 70KB, you can try downloading GUI+ http://www.hpcalc.org/details/7282 |
|||
10-02-2016, 03:28 AM
(This post was last modified: 10-02-2016 03:29 AM by Claudio L..)
Post: #13
|
|||
|
|||
RE: My wishes about NEW-RPL
(10-01-2016 01:54 PM)Maximilian Hohmann Wrote: Hello, Not just you. Actually, newRPL has 3 types of comments: @ = SINGLE LINE @@ = SINGLE LINE PERSISTENT @@@ = MULTI LINE Now the compiler can either compile the comments or not into the binary, based on 2 simple rules: * A flag that indicates if you want comments or not to be included in your code. * The @@ comments ignore the flag, and are always included in your code. So if you are a developer, you'll most likely keep the flag cleared so your comments are preserved across compile/decompile (all of them, not just the @@ permanent ones). When you want to produce a "release" version of your code, you either use the new STRIPCOMMENTS command on the binary, or change the flag and recompile from source. The permanent comment @@ is intended mostly for licensing stuff, that you want even your release binaries to carry. For those interested in testing this: the flag in question is -30, by default this flag is set to 1, indicating comments must be stripped during compile. Just do -30 CF and all your comments will persist. |
|||
10-02-2016, 03:38 AM
Post: #14
|
|||
|
|||
RE: My wishes about NEW-RPL
(10-01-2016 02:11 PM)compsystems Wrote: {1 2 3 } {x y z} ∑LIST * returns You just showed yourself the answer to that question. Every single example you have can be done with the existing list objects by replacing + with ∑LIST, everything else is the same. So you don't really need a new type or new syntax rules to do this. |
|||
10-03-2016, 01:42 PM
(This post was last modified: 10-05-2016 12:43 AM by compsystems.)
Post: #15
|
|||
|
|||
RE: My wishes about NEW-RPL
(10-02-2016 03:38 AM)Claudio L. Wrote:(10-01-2016 02:11 PM)compsystems Wrote: {1 2 3 } {x y z} ∑LIST * returnsYou just showed yourself the answer to that question. Every single example you have can be done with the existing list objects by replacing + with ∑LIST, everything else is the same. This new data type BRACES WITHOUT COMMAS, operate similar to the lists but each command or operator would work with dynamic arity, in the current PRL should I use alternative commands as SIGMALIST; PILIST; DELTALIST, ETC BRACES WITHOUT COMAS (Arg1 arg2 arg3 ... argN) cmd example (Arg1 arg2 arg3 ... argN) + -> Arg1+arg2+arg3+ ... argn (Arg1 arg2 arg3 ... argN) * -> Arg1*arg2*arg3* ... argn (Arg1 arg2 arg3 ... argN) - -> Arg1-arg2-arg3- ... argn (Arg1 arg2 arg3 ... argN) / -> Arg1/arg2/arg3/ ... argn (Arg1 arg2 arg3 ... argN) ABS -> ( ABS(Arg1) ... ABS(Argn) ) 9.1 Also the new data type I want is TUPLA as does HASKELL language Tuple: https://en.wikipedia.org/wiki/Tuple lists and tuples: https://en.wikibooks.org/wiki/Haskell/Lists_and_tuples To differentiate a tuple of a parenthetical list (Arg1 arg2 arg3 ... argN) is necessarily required to use commas haskell examples (True, 1) ("Hello world", False) (4, 5, "Six", True, 'b') ( (2,3,4), True) ( (2,3,4), [2,3] ) [ (1,2), (3,4), (5,6) ] @ list [[1,2],[8,11],[4,5]] @ list of list, same dim [[1,2],[8,11,5],[4,5]] @ list of list more info: http://learnyouahaskell.com/starting-out It is better to separate data types, because the source code is more understandable, it is auto-commented, a single data type for many things creates ambiguity, this is the weak point of the hp-prime xCAS haskell language used lists [] to contain homogeneous lists and tuples ( ... ) for different data types #10: Use constants symbolic for TRUE and FALSE 5 3 > returns 1 best 5 3 > returns TRUE EVAL 1 'IFTE( EXPRESION==TRUE, A1, B0)' TRUE FALSE AND returns FALSE TRUE FALSE OR returns TRUE --------- |
|||
10-05-2016, 12:40 AM
(This post was last modified: 10-05-2016 12:43 AM by compsystems.)
Post: #16
|
|||
|
|||
RE: My wishes about NEW-RPL
#11 A delimiter for numeric bases only on the left side
# X d/h/o/b -> # d/h/o/b X[/color] OR d/h/o/b X # #256d -> #d 256 or d# 256 #100h -> #h 100 or h# 100 #400o -> #o 400 or o# 400 #100000000b -> #b 100000000 or #b 100000000 |
|||
10-22-2016, 09:04 PM
(This post was last modified: 10-23-2016 12:59 AM by compsystems.)
Post: #17
|
|||
|
|||
RE: My wishes about NEW-RPL
#12 (*, ×, ·, SPC ) multiplication sign in stack (text book view)
Show on the stack (text book view) the multiplication sign: depending of a flag on configuration menu convert to triGraphs format with debug4x IDE http://www.debug4x.com/ PHP Code: %%HP: T(0)A(D)F(.); |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)