home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.cad.cadence
- Path: sparky!uunet!inmos!inmos.co.uk!phineas!karlr
- From: karlr@phineas.inmos.co.uk (Karl Relton)
- Subject: Re: edge skill questions
- Message-ID: <1992Jul21.074427.5381@inmos.co.uk>
- Sender: karlr@phineas (Karl Relton)
- Organization: INMOS Limited, Bristol, UK
- References: <lyndon.711657463@angelo>
- Date: Tue, 21 Jul 1992 07:44:27 GMT
- Lines: 37
-
- In article <lyndon.711657463@angelo>, lyndon@angelo.amd.com (Lyndon C. Lim) writes:
- |>
- |> i wanted a generic type checking routine which would use the
- |> internal type checking ability instead of a large case construct
- |> and all the predicate functions.
- |>
- |> i thought i could use a function which defines and calls a second
- |> function which checks the type of its arguments. i included the
- |> code below. i am running into 2 problems:
- |>
- |> [1] PsvDoCheck becomes a function defined with 2 arguments,
- |> instead of one argument, with a defined type.
- |>
- |> [2] The window pops up and complains PsvDoCheck is being
- |> redefined.
- |>
- |> procedure( PsvCheckType(n type)
- |> procedure( PsvDoCheck('var \"type\") t)
- |> PsvDoCheck(n)
- |> )
-
- Try this:
-
- procedure(PsvCheckType(n type)
- apply('procedure list(list('PsvDoCheck 'var type) t))
- PsvDoCheck(n)
- )
-
- The point being that \"type\" evaluates to a variable called "type" (including
- the quotes). The use of apply() enables you to evaluate the local variable
- type to a string, which is then interpreted by the procedure() routine as
- a parameter type specification.
-
- As for the pop-up window in Edge, I know of no way to stop it.
-
- Karl Relton
- INMOS
-