X11 bashing

Bruce Barnett barnett at grymoire.crd.ge.com
Sat Apr 27 00:32:40 AEST 1991


In article <12231 at exodus.Eng.Sun.COM> rberlin at birdlandEng.Sun.COM (Rich Berlin) writes:

>   You could always define a couple of postscript "commands" which do
>   nothing, e.g.
>
>   /|- {} def
>   /-| {} def
>
>   and then mark things like this:
>
>   |- 100 50 8 [1 0 0 -1 0 900] {<00>} false 3 -| colorimage

Yeah - that's what I was thinking of. But would everyone use it?
There would need to be a large number of tools to make this popular.
Like - positioning the mouse on the first bracket and hitting a
command key that executes the commands within the bracket. (Like
lisp). And having double/triple clicks expand fill the brackets. 
Then drag, copy and drop the code from one routine into another, call
up a parser to check for the proper number of parameters. 
(e.g. selected text takes two parameters as input and generates 3
items on the stack.)

You would also need some code to read a PostScript/NeWS program and
generate the proper nesting of brackets. Now there's an interesting
idea!  This would tell you which commands consumed data, and which
ones generated data. It would indicate nesting depth, and might go a
long way to making NeWS easier to use. 

Let's extend the syntax a little. Maybe |- is a bracket indicating
there is the same number of operates on the stack as the matching -|.
If you have a procedure that takes three parameters, and consumes them
all, use a different character. Perhaps |+++ to go with -|?

>   You mentioned in an earlier message that you'd prefer prefix notation,

I wouldn't say it's the prefix part that is important. It's the clear
indication of data flow that I like so much, and vanilla PostScript
lacks.  If NeWS was extended to have this sort of "syntactic sugar"
without penalty, and the tools were added to make this usage
desirable, it might be easier for people to pick up a random piece of
code and follow it without memorizing AHEAD OF TIME the input/output
of every procedure/command used.
--
Bruce G. Barnett	barnett at crdgw1.ge.com	uunet!crdgw1!barnett



More information about the Comp.unix.internals mailing list