alan-if / alan-docs

Alan IF Documentation Project

Home Page:https://git.io/alan-docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document IsA Container

tajmone opened this issue · comments

See also #45 on IsA Container.

In §2.4. Introduction to the Language » The SYNTAX we encounter the first usage example of IsA Container:

It is also possible to restrict the types of the parameters:

Syntax
  put_in = 'put' (obj) 'in' (cont)
    Where obj IsA object
      Else "You can't put that into anything."
    And cont IsA Container
      Else "Nothing fits inside that."

This restricts the parameter obj to being an instance inheriting from the object class (as opposed to an actor for example) and the parameter cont to a Container (an instance with the Container property).

It's worth adding a note/admonition there about the special use of IsA with a non-class.