home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / cad / cadence / 176 next >
Encoding:
Text File  |  1992-07-20  |  1.6 KB  |  49 lines

  1. Newsgroups: comp.cad.cadence
  2. Path: sparky!uunet!inmos!inmos.co.uk!phineas!karlr
  3. From: karlr@phineas.inmos.co.uk (Karl Relton)
  4. Subject: Re: edge skill questions
  5. Message-ID: <1992Jul21.074427.5381@inmos.co.uk>
  6. Sender: karlr@phineas (Karl Relton)
  7. Organization: INMOS Limited, Bristol, UK
  8. References:  <lyndon.711657463@angelo>
  9. Date: Tue, 21 Jul 1992 07:44:27 GMT
  10. Lines: 37
  11.  
  12. In article <lyndon.711657463@angelo>, lyndon@angelo.amd.com (Lyndon C. Lim) writes:
  13. |> 
  14. |> i wanted a generic type checking routine which would use the
  15. |> internal type checking ability instead of a large case construct
  16. |> and all the predicate functions.
  17. |> 
  18. |> i thought i could use a function which defines and calls a second
  19. |> function which checks the type of its arguments.  i included the
  20. |> code below.  i am running into 2 problems:
  21. |> 
  22. |>     [1] PsvDoCheck becomes a function defined with 2 arguments,
  23. |>         instead of one argument, with a defined type.
  24. |> 
  25. |>     [2] The window pops up and complains PsvDoCheck is being
  26. |>         redefined.
  27. |> 
  28. |> procedure( PsvCheckType(n type)
  29. |>     procedure( PsvDoCheck('var \"type\") t)
  30. |>     PsvDoCheck(n)
  31. |> )
  32.  
  33. Try this:
  34.  
  35. procedure(PsvCheckType(n type)
  36.   apply('procedure list(list('PsvDoCheck 'var type) t))
  37.   PsvDoCheck(n)
  38. )
  39.  
  40. The point being that \"type\" evaluates to a variable called "type" (including
  41. the quotes). The use of apply() enables you to evaluate the local variable
  42. type to a string, which is then interpreted by the procedure() routine as
  43. a parameter type specification.
  44.  
  45. As for the pop-up window in Edge, I know of no way to stop it.
  46.  
  47. Karl Relton
  48. INMOS
  49.