[xCAS request] functions in infix notation,
09-28-2016, 07:41 PM (This post was last modified: 09-28-2016 07:45 PM by compsystems.)
Post: #1
 compsystems Senior Member Posts: 1,193 Joined: Dec 2013
[xCAS request] functions in infix notation,
Hello Haskell is a functional language and has the option to define functions in prefix or infix notation, while that the hp-prime only prefix notation

PREFIX means the function name is before of the arguments

Example in prefix notation:
FUCTIONAME (arg1, arg2, argN) := expresion

ADDITION (X, Y) := X + Y // definition
returns 7

Infix means that the function name is between the arguments

Example:
arg1 FUCTIONAME arg2
X ADDITION Y: = X + Y

To denote that a function is in infix, HASKELL LANGUAGE use quotes inclined to the left 
X ADDITION Y: = X + Y // definition
returns 7

This and similar to MODULO function

23 MOD 5
returns 3

For n arguments groups in parenthesis

(Arg1, arg2, argn) FUCTIONAME (arg1, arg2, argn) := ...

I think that the HP48 / 50 in SYSPRL can create this kind of infix functions,

can incorporate it into xcas?

the purpose is to create and writing functions nearest to math textbooks
09-29-2016, 05:56 AM
Post: #2
 parisse Senior Member Posts: 1,050 Joined: Dec 2013
RE: [xCAS request] functions in infix notation,
This is supported in Giac/Xcas but not on the Prime, for example :
Code:
user_operator("R",(x,y)->x*y+x+y,Binary)
Code:
2 R 3
09-29-2016, 11:30 AM
Post: #3
 compsystems Senior Member Posts: 1,193 Joined: Dec 2013
RE: [xCAS request] functions in infix notation,
Xcas is great =), we need a "HP-Prime xcas"

and, what is the syntax for n arguments?
09-29-2016, 06:35 PM
Post: #4
 parisse Senior Member Posts: 1,050 Joined: Dec 2013
RE: [xCAS request] functions in infix notation,
It works only for unary/binary.
 « Next Oldest | Next Newest »

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