|Extension Languages email@example.com (1992-12-14)|
|Re: Extension Languages xjam@cork.CS.Berkeley.EDU (1992-12-14)|
|Re: Extension Languages firstname.lastname@example.org (1992-12-14)|
|Re: Extension Languages email@example.com (Dave Gillespie) (1992-12-15)|
|Re: Extension Languages firstname.lastname@example.org (1992-12-16)|
|Re: Extension Languages email@example.com (1992-12-17)|
|Re: Extension Languages firstname.lastname@example.org (Peter Ludemann) (1992-12-17)|
|Re: Extension Languages email@example.com (1992-12-18)|
|Re: Extension Languages firstname.lastname@example.org (Dave Gillespie) (1992-12-19)|
|From:||email@example.com (John E. Davis)|
|Organization:||Dept. of Physics, The Ohio State University|
|Date:||Mon, 14 Dec 1992 17:11:06 GMT|
firstname.lastname@example.org (Mark Stavar) writes:
IS there any specific reason why one would choose to utilise an prefix
notation language for extensions to an editor as opposed to infix or
For my JED editor, I invented a language which I call S-Lang or
``Ssslang''. It is stack based and resembles postscript in many ways.
However unlike other stack based languages, it supports local variables
which tremendously simply taking care of the stack. However, this is not
just an editor language--- rather it is a language embedded into the
editor. I am currently writing a program which utilizes a frame grabber
and I have embedded the languge in it as well. So for example, suppose I
have a C function called `draw' which takes 4 integers and draws a line
between two points and returns nothing. Then to embed this function in
the language, simply put:
add_intrinsic("line", draw, VOID_TYPE, 4);
in your C program. Then you can call the function from within Slang:
1 1 10 10 line ;; draws a line between points (1,1) and (10,10)
Then you can create a function called `box':
( [x1 y1 x2 y2] ;; local variables
=y2 =x2 =y1 =x1
x1 y1 x1 y2 line
x1 y2 x2 y2 line
x2 y2 x2 y1 line
x2 y1 x1 y1 line
Then `1 2 10 12 box' will draw a box with two corners at (1,2) and
(10,12). I think that you can see how such a program adds a new dimension
to a program with a C function called draw. In addition, think about how
you would have to write the box function with NO local variables using
stack operators `dup', `exch', `roll', etc....
The reason I chose a stack based language is easy: The parsing stage is
simple. I did not want most of the executable devoted to the language.
I will release Slang as a standalone product soon. Of course it is not
really standalone because it needs to be embedded into you application.
Look at my JED sources (in ledit.c) to see how Slang is embedded.
John E. Davis
bitnet: davis@ohstpy office: 617-735-6746
Return to the
Search the comp.compilers archives again.