Post Reply 
newRPL: DATA TYPES USING [] AS ELEMENT CONTAINER
04-15-2017, 04:10 AM (This post was last modified: 04-17-2017 02:46 AM by compsystems.)
Post: #3
RE: newRPL: DATA TYPES USING [] AS ELEMENT CONTAINER
Vtile thanks for your reply


For the case L[ 3, {4}, "hello" ] → { 3, { 4 }, "hello" } is simply a container conversion, you can write directly { 3, { 4 }, "hello" }

The prefixes are
Set: s[]
PoLynomial: pl[]
Rectangular (complex or vector) : r[]
Polar for complex numbers or vectors in cylindrical coordinates : p[]
SPherical coordinates for vectors: sp[]
Coordinates (Graphics): g[]

without prefix or optional
vector: [] optional v[]
matrix: [[]], optional m[]
list: {} , optional L[]

With templates the number of keystrokes is reduced, it also includes the prefixes and posfixes automatically
[Image: 2Dtemplates_image00.png]

Circular Parentesis () is the most common option, but it is used as container args of functions f(x,y), complex numbers (x,y) or (r,Φ), to represent a point (x,y) (x,y,z), extraction of elements of a vector o list {9,8,7}(3), [4,5,6](2), etc another option is to use other special containers for each object which are very scarce and even in UNICODE
« » occupied
´ ´ free
` ` free
¨ ¨ free
' ' occupied
" " occupied

Now think if you want to subtract two polynomials, with the vectorial form that I propose you save several pulsations, you can check the coefficients better, not depend on a variable or have to delete it previously etc,

(2*x^3+x^2-3*x-5)-(x^3-3*x^2+4*x-7) // 33 chars, ALG format
pl[2,1,-3,-5]-pl[1,-3,4,-7] // 27 chars, "vector" format
pl[2,1,-3,-5] pl[1,-3,4,-7] - // 29 chars, "vector" format RPL
2 x 3 ^ * x 2 ^ + 3 x * - 5 - x 3 ^ 3 x 2 ^ * - 4 x * + 7 - - // 61 chars, RPL
'(2*x^3+x^2-3*x-5)-(x^3-3*x^2+4*x-7)' // 35 chars symb ALG format

you can also extract each part or element easily
pl[2,1,-3,-5](2) → 1 // ALG
pl[2,1,-3,-5] 2 GET → 1 // RPL

Using prefixes, prefixes[], each object respects its algebra, vector algebra, algebra of complex numbers, polynomials, sets and any other type of data included in the future
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: newRPL: DATA TYPES USING [] AS ELEMENT CONTAINER - compsystems - 04-15-2017 04:10 AM



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