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


Groups > comp.lang.postscript > #2559

Re: How to test if a procedure is defined ?

Newsgroups comp.lang.postscript
From Peter Billam <peter@www.pjb.com.au>
Subject Re: How to test if a procedure is defined ?
References <slrnnibqmm.54q.peter@box8.pjb.com.au> <ng5271$ufi$1@dont-email.me>
Message-ID <slrnnida14.1og.peter@box8.pjb.com.au> (permalink)
Date 2016-05-02 01:06 +0000
Organization Unlimited download news at news.astraweb.com

Show all headers | View raw


On 2016-05-01, Martin Leese <please@see.Web.for.e-mail.INVALID> wrote:
> Peter Billam wrote:
>> I'm wanting to put together something like perl or lua
>> 'require', by testing if some procedure is defined, and if
>> not then run-ning the PS 'library' file that will define it.
> Try:
>    yourdict /gloop known
> or, if the appropriate dictionary is on the dictionary stack:
>    /gloop where

Yes :-) where is what I needed (never used it before). Concretely:

  /randomrgb where not { (/home/pjb/ps/lib/colours.ps) run } if

Thanks,
Peter

-- 

Peter Billam    www.pjb.com.au    www.pjb.com.au/comp/contact.html

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


Thread

How to test if a procedure is defined ? Peter Billam <peter@www.pjb.com.au> - 2016-05-01 11:39 +0000
  Re: How to test if a procedure is defined ? Martin Leese <please@see.Web.for.e-mail.INVALID> - 2016-05-01 08:04 -0600
    Re: How to test if a procedure is defined ? Peter Billam <peter@www.pjb.com.au> - 2016-05-02 01:06 +0000
      Re: How to test if a procedure is defined ? luser- -droog <mijoryx@yahoo.com> - 2016-05-01 19:45 -0700
        Re: How to test if a procedure is defined ? Peter Billam <peter@www.pjb.com.au> - 2016-05-02 05:48 +0000

csiph-web