Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • transmorphic found where struct expected

    Dear All,

    I am trying to understand why the declaration for a variable is required in the definition of a function, but not required during the interactive use.

    Refer to page 7 of the documentation for xl(). It shows both the interactive use and a use inside a function. The question is specifically regarding the code line:
    Code:
    class xl scalar b
    Why may it be omitted in the interactive use, but must be specified in the definition of a function??
    IMHO whether a certain portion of the code is enveloped in a procedural definition or not is irrelevant for that code.
    The specific mentioning and illustration of this in the documentation indicates that this is intended, and not a random bug, but I can't grasp why.

    Also, the error message which is produced in this case ("type mismatch: exp.exp: transmorphic found where struct expected") is not exactly transparent as to the nature of the problem, especially since it is produced after the methods are being used, not after the constructor being called.

    Thank you, Sergiy Radyakin
Working...
X