Keep RPL/2 project alive. Please donate.

Standalone language

rpl

Program allowing the execution of scripts written in RPL/2. These programs can be interpreted or compiled. It is possible to launch this program to obtain interactive command line or to run some commands from standard input.

RPL/2(1)                       RPL/2 user manual                       RPL/2(1)

NAME
       Reverse Polish Lisp/2 release 4.1.36,
       half-compiled  high-level language using shared libaries and mainly aim-
       ing at scientific calculations and complex algorithms

SYNOPSIS
       rpl [-acdDhilnpPsv] [-A data] [-S script] [-t level] [program]

DESCRIPTION
       The rpl sequencer allows either the execution of a RPL/2 program or  the
       opening of an interactive session to enter commands directly

OPTIONS
       -a     analyzes program and sends preprocessor output to standard output

       -A     sends parameters to main program

       -c     allows  creation  of  a rpl-core file, providing a way to debug a
              program

       -d     debugs memory allocations inside RPL/2. Do not use if you do  not
              know what you do!

       -D     launches RPL/2 in daemon mode

       -h     shows a summary of available options

       -i     runs  the  RPL/2 sequencer in interactive mode. This option can't
              be used with a program name as argument

       -l     prints the user licence of the software

       -n     ignores HUP signal

       -p     precompiles scripts before execution

       -P or -PP
              computes profile data

       -s     disables splash screen

       -S     executes script on command line

       -t     enables tracing mode. Each internal operation is echoed on  stan-
              dard output

       -v     prints the version number

EXIT STATUS
       The  sequencer  returns  a  value of 0 if no error occurs when running a
       program, else it returns a nonzero value.

PREREQUISITES AND VARIOUS ADVICES
       RPL_TMP_PATH env variable is used to specify the location of  tempfiles.
       If  this  variable  is not set, RPL/2 tries to use /tmp, /var/tmp or ./.
       It is also recommended to use gnuplot, TeX/LaTeX, dvips and gv in  asso-
       ciation with RPL/2, to get advanced graphical capabilities

RELATED STANDARDS
       The RPL/2 sequencer is compliant with the HP-28S calculator user manual,
       and  with  the HP-28S itself, in its 2BB version (C) HP 1986-1987.  Some
       operations dealing with complex numbers are not  following  the  defini-
       tions  from  HP,  because  they  are bogus. The main such operations are
       transposition and scalar product.

DELIMITERS
       none   scalar, integer or real number, coded with at least 64 bits;

       ( )    complex number, coded with at least 128 bits;

       #      binary integer, 64 bits of length;

       << >>  user-defined function, or equation (expressed in RPN);

       ' '    algebraic equation or variable name;

       [ ]    scalar vector;

       [[ ]]  scalar matrix;

       <[ ]>  table;

       " "    character string;

       { }    list containing various  objects.  A  list  might  contain  other
              lists;

       /* */  comment;

       //     comment running to the end of a line;

INSTRUCTIONS
       We  list in this section the build-in instructions of the language. Some
       might be written in several ways; the alternatives ways are  listed  be-
       tween  parenthesis.  Definitions  between parenthesis in a structure are
       optional. Instructions written in upper case are not case-sensitive.

       CONTROL STRUCTURES
              IF/THEN/(ELSEIF/THEN)/(ELSE)/END,      IFT,       IFTE,       SE-
              LECT/CASE/THEN/END/(DEFAULT)/END

       ERROR HANDLING
              CLRERR, ERRM, ERRN, IFERR/THEN/(ELSE)/END

       LOOPS PROVIDING A COUNT
              FOR/(CYCLE)/(EXIT)/NEXT,   FOR/(CYCLE)/(EXIT)/STEP,   FORALL/(CY-
              CLE)/(EXIT)/NEXT

       LOOPS WITHOUT COUNT
              START/(CYCLE)/(EXIT)/NEXT, START/(CYCLE)/(EXIT)/STEP

       UNDEFINED LOOPS
              DO/(EXIT)/UNTIL/(EXIT)/END, WHILE/(EXIT)/REPEAT/(EXIT)/END

       INPUT/OUTPUT
              BEEP, CLMF, DISP, INPUT, KEY, PROMPT

       DEBUGGING
              CONT, HALT, SST

       STACK HANDLING
              CLEAR, COPY, DEPTH, DROP, DROP2, DROPN, DUP,  DUP2,  DUPN,  EDIT,
              OVER, PICK, ROLL, ROLLD, ROT, SWAP

       WORKING WITH VARIABLES
              ->, CLUSR, PARAMETER, PRIVATE, PROTECT, PURGE, RCEQ, RCL, RECALL,
              SAVE,  SCONJ,  SHARED, SINV, SNEG, STATIC, STEQ, STO, STO+, STO-,
              STO*, STO/, STORE, UNPROTECT, VARIABLE, VARS, VISIT, VOLATILE

       ARITHMETICAL OPERATIONS AND ELEMENTARY CALCULUS
              +, -, *, /, ^ (**), =, %, %CH, %T, ABS, ARG,  C->R,  CEIL,  CONJ,
              DECR,  DER,  DFT,  EVAL,  EXP,  EXPM, FACT, FFT, FLOOR, FP, IDFT,
              IFFT, IM, INCR, INT, INV, IP, MANT, MAX, MCLRIN, MIN,  MOD,  NEG,
              ->NUM,  P->R,  ->Q, R->C, R->P, RE, RELAX, SIGN, SQ, SQRT, TAYLR,
              XPON, XROOT

       CONSTANTS
              e, FALSE, i, infinity, PI, TRUE

       FORMATTING
              ENG, FIX, RND, SCI, STD, TRNC

       LOGICAL AND BINARY OPERATIONS
              <, <= (=<), <>, >, >= (=>), ==, AND, ASL,  ASR,  B->R,  BIN,  CF,
              DEC,  EQV,  FC?,  FC?C, FC?S, FS?, FS?C, FS?S, HEX, IN, NOT, OCT,
              OR, R->B, RCLF, RCWS, RL, RLB, RR, RRB, SAME, SF,  SL,  SLB,  SR,
              SRB, STOF, STWS, XOR

       TRIGONOMETRY
              ACOS, ASIN, ATAN, COS, D->R, DEG, ->HMS, HMS->, HMS-, HMS+, R->D,
              RAD, SIN, TAN

       LOGARITHMS
              ACOSH, ALOG, ASINH, ATANH, COSH, LN, LNP1, LOG, SINH, TANH

       SPECIAL FUNCTIONS
              BESSEL, GAMMA

       STATISTICS
              CLS,  COLS,  COMB,  CORR, COV, DRWS, MAXS, MEAN, MINS, NRAND, NS,
              PCOV, PERM, PSDEV, PVAR, RAND, RCLS, RDGN,  RDZ,  S-,  S+,  SCLS,
              SDEV,  SPAR,  STOS, SX, SX2, SXY, SY, SY2, TOT, UTPC, UTPF, UTPN,
              UTPT, VAR, XCOL, YCOL

       DEALING WITH MATRIX AND VECTOR
              ->ARRAY (->ARRY), ARRAY->  (ARRY->),  CNRM,  COL+,  COL-,  COL->,
              ->COL,  CON,  COND,  CROSS,  CSWP, DET, DOT, DIAG->, ->DIAG, EGV,
              EGVL, GEGV, GEGVL, GET, GETC,  GETI,  GETR,  GLEGV,  GREGV,  IDN,
              LCHOL,  LEGV,  LQ,  LSQ, LU, MAX, MIN, PUT, PUTC, PUTI, PUTR, QR,
              RANK, RCI, RCIJ, RDM, REGV, RNRM, ROW+, ROW-, ROW->, ->ROW,  RSD,
              RSWP, SCHUR, SIZE, SQ, SVD, SVL, TRN, UCHOL

       DEALING WITH TABLES
              CRTAB, GET, L->T, PUT, RECORD, T->L, ->TABLE, TABLE->

       LISTS  GET,  GETI,  HEAD,  L->T,  ->LIST,  LIST->, POS, PUT, PUTI, REPL,
              REVLIST, SIZE, SORT, SUB, T->L, TAIL

       STRINGS
              CHR, CURRENC, LCASE, NUM, POS, RECODE, REGEX, REPL,  RGDL,  RGDR,
              SIZE, SREV, ->STR, STR->, SUB, TOKENIZE, TRIM, UCASE

       EXPRESSIONS HANDLING
              OBGET, OBSUB, EXGET, EXSUB

       FILE AND SOCKET HANDLING
              APPEND,  BACKSPACE,  CLOSE,  CLRSOCK, CREATE, DELETE, FORMAT, IN-
              QUIRE, LOCK, OPEN, POLL,  READ,  REWIND,  SYNC,  TARGET,  UNLOCK,
              WFLOCK, WFSOCK, WRITE

       GRAPHICAL OUTPUT AND PRINTING
              *D,  *H, *S, *W, AUTOSCALE, AXES, CENTR, CLLCD, CR, DEPND, DGTIZ,
              DRAW, DRAX, ERASE,  EYEPT,  FUNCTION,  HISTOGRAM,  INDEP,  LABEL,
              LCD->,  ->LCD, LINE, LOGSCALE, MARK, NEWPLANE, PAPER, PARAMETRIC,
              PERSIST, PLOT, PLOTTER, PMAX,  PMIN,  POLAR,  PPAR,  PR1,  PRINT,
              PRLCD,  PRMD,  PRST,  PRSTC,  PRUSR, PRVAR, REDRAW, RES, SCATTER,
              SCALE, SLICE, SLICESCALE, TITLE, WIREFRAME

       LIBRARIES
              EXTERNALS, REMOVE, USE

       PROCESS
              ATEXIT, ATPOKE, CLRATEXIT, CLRATPOKE, CLRFUSE, CLRMTX,  CLRSMPHR,
              CLRSWI, CONTINUE, CRITICAL/END, CRMTX, CRSMPHR, CSTOP, DAEMONIZE,
              DETACH,  FUSE,  ISWI,  MTXLOCK, MTXSTATUS, MTXTRYLOCK, MTXUNLOCK,
              NBRCPUS, NRPROC, PEEK, POKE, PROCID, RCLSWI, RECV, RFUSE,  RSTOP,
              SCHED,   SEND,  SMPHRDECR,  SMPHRGETV,  SMPHRINCR,  SMPHRTRYDECR,
              SPAWN, STOP, STOSWI, SUSPEND, SWI, SWILOCK, SWIQUEUE,  SWISTATUS,
              SWIUNLOCK, WFACK, WFDATA, WFPOKE, WFPROC, WFSWI, YIELD

       MISC   <<, >>, ABORT, ALARM, BACKTRACE, CIPHER, CLRCNTXT, COMPRESS, CON-
              VERT,  COPYRIGHT,  DATE,  DIGEST,  DROPCNTXT, DUPCNTXT, HELP, IM-
              PLICIT, ITRACE, JDATE, KILL,  LAST,  LOCALIZATION,  LOGGER,  MEM,
              MEMLOCK,  MEMUNLOCK, PSHCNTXT, PSHPRFL, PULCNTXT, PULPRFL, RDATE,
              RESTART, RETURN, SPLASH, SWAPCNTXT, SYSEVAL, TIME,  TYPE,  UNCOM-
              PRESS, VERIFY, VERSION, WAIT, WARRANTY, WORKDIR

       DATABASES
              SQLCONNECT, SQLDISCONNECT, SQLQUERY

       PREPROSSESSING
              #date,  #define,  #defeval,  #else, #endif, #error, #eval, #file,
              #if, #ifdef, #ifeq, #ifndef, #ifneq, #include, #line, #mode, #un-
              def, #warning

USEFUL LINKS
       http://www.rpl2.net
              official WWW page of RPL/2;

       jkb@systella.fr
              the author's email address;

       rpl2@rayleigh.systella.fr
              RPL/2 mailing-list, useful to ask some advice,  report  bugs  and
              talk about new features

JKB-Labs             Thursday,  4 July 2024 10:41:31 +0200             RPL/2(1)

rplc

This program is the only one of RPL/2 family that is not distributed under CeCILL license. Today, there is no public available release. This tool is required to build standalone binary RPL/2 executable.

tchebytchev:[~/rpl/rplc-1.0.0] > cat hello.rpl
#!/usr/local/bin/rpl -sp

MAIN
<<
    "Hello, World!" disp
>>
tchebytchev:[~/rpl/rplc-1.0.0] > ./rplc hello.rpl hello
tchebytchev:[~/rpl/rplc-1.0.0] > file hello
hello: ELF 32-bit MSB executable, SPARC32PLUS, V8+ Required, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
tchebytchev:[~/rpl/rplc-1.0.0] > ./hello
+++RPL/2 (R) version 4.0.13 (Monday 03/15/10, 12:57:39 CET)
+++Copyright (C) 1989 to 2009, 2010 BERTRAND Joel
Hello, World!
tchebytchev:[~/rpl/rplc-1.0.0] > 

Shared libraries

mkrplso

RPL/2(1)                       RPL/2 user manual                       RPL/2(1)

NAME
       Compile  and  build  RPL/C external modules for RPL/2 language (DEVELOP-
       MENT, RPL/2)

SYNOPSIS
       mkrplso [options] filename

DESCRIPTION
       The mkrplso utility is a gfortran wrapper used to compile or build RPL/2
       exteral modules. All available options are described in gfortran manual.

OPTIONS
       See gfortran.

JKB-Labs             Thursday,  4 July 2024 10:41:31 +0200             RPL/2(1)

rplcc

RPL/2(1)                       RPL/2 user manual                       RPL/2(1)

NAME
       Compile  C  source code that calls one or more RPL/2 functions (DEVELOP-
       MENT, RPL/2)

SYNOPSIS
       rplcc [options] filename

DESCRIPTION
       The rplc utility is a gfortran wrapper. All available  options  are  de-
       scribed in gfortran manual.

OPTIONS
       See gfortran.

JKB-Labs             Thursday,  4 July 2024 10:41:31 +0200             RPL/2(1)

rpllink

RPL/2(1)                       RPL/2 user manual                       RPL/2(1)

NAME
       Link  C source code that calls one or more RPL/2 functions (DEVELOPMENT,
       RPL/2)

SYNOPSIS
       rpllink [options] filename

DESCRIPTION
       The rpllink utility is a gfortran wrapper. All available options are de-
       scribed in gfortran manual.

OPTIONS
       See gfortran.

JKB-Labs             Thursday,  4 July 2024 10:41:31 +0200             RPL/2(1)

Tools

rplpp

This preprocessor is not other than gpp, a preprocessor of general use adapted to RPL/2 language.

rpltags

RPL/2(1)                       RPL/2 user manual                       RPL/2(1)

NAME
       rpltags - create a tags file (DEVELOPMENT, RPL/2)

SYNOPSIS
       rpltags pathname

DESCRIPTION
       The rpltags utility shall be provided on systems that support RPL/2 lan-
       guage.

       The  rpltags  utility shall write a tagsfile or an index of objects from
       RPL/2-language source files specified  by  the  pathname  operands.  The
       tagsfile shall list the locators of language-specific objects within the
       source  files.   A  locator  consists  of a name, pathname, and either a
       search pattern or a line number that can be used in  searching  for  the
       object definition.

OPTIONS
       None

JKB-Labs             Thursday,  4 July 2024 10:41:31 +0200             RPL/2(1)

Others

rplawk

As some systems do not have decent AWK tool, RPL/2 has its own implementation. This AWK is written by Brian Kernighan and modified to remove yacc dependency.

rplconvert

It is a renamed GNU units used to do units conversions.

rplfile

Due to some bugs in file tool provided by some operating systems, RPL/2 is shipped with a patched NetBSD file renamed in rplfile.

rpliconv

RPL/2 adapts outputs to current localization. rpliconv is used to translate file encoding before compilation.

© 2009-2021 BERTRAND Joël