Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #2961

Re: Do you ever use the obscure PostScript command '...'?

Newsgroups comp.lang.postscript
Date 2016-12-04 13:42 -0800
References <711068ba-9b2b-4535-9f7f-f0d160ded354@googlegroups.com> <1d356247-6e20-4d3b-bddb-646338032627@googlegroups.com> <c5d6e2a7-221e-4dad-a060-39fc33577a92@googlegroups.com>
Message-ID <d3976d4e-710f-4634-b07a-7be11e31822d@googlegroups.com> (permalink)
Subject Re: Do you ever use the obscure PostScript command '...'?
From luser droog <luser.droog@gmail.com>

Show all headers | View raw


On Saturday, December 3, 2016 at 6:49:02 PM UTC-6, jdaw1 wrote:
> Do you ever use the obscure PostScript command ‘cvlit’, except after ‘type’?

I use `cvlit` quite a bit, almost as often as `cvx`, but I think I've /never/
used it after `type`. I think I didn't even realise that the result of `type`
is an executable name was in reading the commentary in Braswell's /Inside 
Postscript/ when he breaks down the `==` procedure.

For `type` I use it when trying to check types of arguments in a procedure[1]

% (string)  func  -
/func {
    dup type /stringtype ne{
        /func cvx /typecheck signalerror
    if

    pop
} def

For `cvlit`, I've used it sometimes to provide a different "view" 
of part of an executable array. Mostly when doing things like 
scanning through a nested array structure recursively. But also
with writing looping procedures that behave more like looping 
operators.

Like if you wanted a variable to hold the two values of currentpoint
together and be easily updatable and easy to put the values back on
the stack.

%saved point
/cp [ 10 10 ] cvx def
/cparray /cp load cvlit def

% x y  save-point  -
/save-point{
  cparray astore
} def

(above code is "pessimized" to show usage of both cvlit and cvx,
but practically you can use just one or the other usually, by
constructing the object with the desired attribute to begin with,
ie. [ ... ] cvx  -->  { ... }, with the complication that there
can be a significant difference in the meaning of '...' here.)

[1] note `signalerror` is ghostscript's (better) name for Adobe's undocumented
`.error` procedure.

Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Do you ever use the obscure PostScript command '...'? jdaw1 <jdawiseman@gmail.com> - 2016-03-27 12:04 -0700
  Re: Do you ever use the obscure PostScript command '...'? Markus Triska <triska@metalevel.at> - 2016-03-27 22:57 +0200
    Re: Do you ever use the obscure PostScript command '...'? Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-06-01 18:37 -0700
      Re: Do you ever use the obscure PostScript command '...'? Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-06-01 18:44 -0700
  Re: Do you ever use the obscure PostScript command '...'? luser- -droog <mijoryx@yahoo.com> - 2016-03-27 14:02 -0700
    Re: Do you ever use the obscure PostScript command '...'? jdaw1 <jdawiseman@gmail.com> - 2016-03-28 06:32 -0700
      Re: Do you ever use the obscure PostScript command '...'? Markus Triska <triska@metalevel.at> - 2016-03-28 16:53 +0200
      Re: Do you ever use the obscure PostScript command '...'? luser- -droog <mijoryx@yahoo.com> - 2016-03-28 13:07 -0700
  Re: Do you ever use the obscure PostScript command '...'? Martin Leese <please@see.Web.for.e-mail.INVALID> - 2016-03-28 18:55 -0600
  Re: Do you ever use the obscure PostScript command '...'? jdaw1 <jdawiseman@gmail.com> - 2016-04-02 16:22 -0700
    Re: Do you ever use the obscure PostScript command '...'? luser- -droog <mijoryx@yahoo.com> - 2016-04-02 22:03 -0700
  Re: Do you ever use the obscure PostScript command '...'? jdaw1 <jdawiseman@gmail.com> - 2016-04-13 06:09 -0700
    Re: Do you ever use the obscure PostScript command '...'? jdaw1 <jdawiseman@gmail.com> - 2016-04-14 10:02 -0700
      Re: Do you ever use the obscure PostScript command '...'? luser- -droog <mijoryx@yahoo.com> - 2016-04-14 20:24 -0700
        Re: Do you ever use the obscure PostScript command '...'? luser- -droog <mijoryx@yahoo.com> - 2016-04-14 20:28 -0700
        Re: Do you ever use the obscure PostScript command '...'? jdaw1 <jdawiseman@gmail.com> - 2016-04-15 15:49 -0700
          Re: Do you ever use the obscure PostScript command '...'? luser- -droog <mijoryx@yahoo.com> - 2016-04-15 23:30 -0700
            Re: Do you ever use the obscure PostScript command '...'? jdaw1 <jdawiseman@gmail.com> - 2016-04-16 04:49 -0700
  Re: Do you ever use the obscure PostScript command '...'? jdaw1 <jdawiseman@gmail.com> - 2016-12-03 16:27 -0800
    Re: Do you ever use the obscure PostScript command '...'? jdaw1 <jdawiseman@gmail.com> - 2016-12-03 16:49 -0800
      Re: Do you ever use the obscure PostScript command '...'? luser droog <luser.droog@gmail.com> - 2016-12-04 13:42 -0800
    Re: Do you ever use the obscure PostScript command '...'? luser droog <luser.droog@gmail.com> - 2016-12-08 20:37 -0800
    Re: Do you ever use the obscure PostScript command '...'? Mark Carroll <mtbc@bcs.org> - 2016-12-20 17:01 +0000

csiph-web