DIRECTORY Rope USING [ROPE]; Express: CEDAR DEFINITIONS ~ { OPEN R: Rope; ROPE: TYPE ~ R.ROPE; Symbols: TYPE ~ LIST OF ROPE; Fcn: TYPE ~ PROC [a,b,c,d,e: REAL _ 0] RETURNS [z: REAL]; ParseError: ERROR [error: ErrorDesc]; ErrorDesc: TYPE ~ RECORD [ reason: ROPE, position: INT ]; IllegalClientProcedure: ERROR; ClientProc: TYPE ~ RECORD [ proc: PROC ANY RETURNS [REAL], --Actually ANY must be 1 or 2 REALs userRope: ROPE --What client's user will call it ]; ClientProcList: TYPE ~ LIST OF ClientProc; RopeToFcn: PROC [ expression: ROPE, symbols: Symbols, --Up to five, corresponding to a,b,c,d,e cProcs: ClientProcList _ NIL, oldFcn: Fcn _ NIL ] RETURNS [fcn: Fcn]; FreeFcn: UNSAFE PROC [fcn: Fcn]; }. jExpress.mesa Express provides the client a way to evaluate an arithmetic expression given in a rope (generally from the user), typically faster than Interpreter or JaM, especially if the same function is used repeatedly. Created Thursday, June 28, 1984 10:25 am PDT Last edited by Eric Nickell, July 17, 1984 9:54:43 pm PDT Someday, hopefully, this type will become more general This is the parsing procedure, and is therefore fairly expensive. Time is spent here, so that it may be save in EvalFcn below. The algebraic constructs available are now documented here, as they are changing periodically, which makes documenting in the interface a poor idea, unfortunately. The current stuff can be found in ExpressDoc. symbols is the list of ROPEs that identify the arguments, IN THE ORDER they will be passed to EvalFcn. oldFcn, if provided, will inform the system that you have no further need of that procedure. (Unfortunately, Express can't tell about the dangling reference problem. Oh, well.) RopeToFcn may return the same procedure (possibly tweeked) as you gave it (if you were generous enough to give it anything), or it may not. Clients: Once you get fcn back into the privacy of your own module, then calls of the form fcn[a,b,c,d,e] will get you a result... Deallocates the procedure. Do not do this if the function will be passed back as oldFcn to RopeToFcn. ส๛˜šœ ™ J™ฯJšœ,™,J™9J™—šฯk ˜ Jšœœœ˜J˜—šœ œ œ˜Jšœœ˜ Jšœœœœ˜—J˜Jš œ œœœœ˜š ฯnœœœ œœœ˜9J™6—J˜Jšœ œ˜%šœ œœ˜Jšœœ˜ Jšœ ˜ J˜—šœœ˜J˜—šž œœœ˜Jš œœœœœฯc#˜CJšœ œŸ!˜7J˜—šœœœœ ˜*J˜—šž œ˜šœ˜Jšœ œ˜JšœŸ(˜?Jšœœ˜Jšœ˜Jšœ˜—Jšœ ˜J™J™Jšœ6ฯbœ™™ำJ™fJšœพ œ~™ฟJ™—™[Iquote™—Idefault™J˜šžœœœ ˜ J™f—J˜J˜—…—า 7