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


Groups > comp.lang.postscript > #2558

Re: How to test if a procedure is defined ?

From Martin Leese <please@see.Web.for.e-mail.INVALID>
Newsgroups comp.lang.postscript
Subject Re: How to test if a procedure is defined ?
Date 2016-05-01 08:04 -0600
Organization A noiseless patient Spider
Message-ID <ng5271$ufi$1@dont-email.me> (permalink)
References <slrnnibqmm.54q.peter@box8.pjb.com.au>

Show all headers | View raw


Peter Billam wrote:
> Greetings.  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.
> But I don't see how to test if a procedure is defined. Anything like
>   gloop type  or  gloop gcheck
> just crashes if gloop is undefined, before type or gcheck get executed.
>   /gloop type
> just reports nametype, even if  gloop  doesn't exist.
> Is there eg: a way to invoke  gloop  within a crash-free sandbox,
> eg like  pcall  in lua ?  Any other way to test if it's defined ?

Try:
     yourdict /gloop known
or, if the appropriate dictionary is on the dictionary stack:
     /gloop where

-- 
Regards,
Martin Leese
E-mail: please@see.Web.for.e-mail.INVALID
Web: http://members.tripod.com/martin_leese/

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