Is (keyword)

From RemObjects Software

Jump to: navigation, search

This is a Oxygene Keyword topic
Feel free to add your notes to this topic below.


This keyword is used in two contexts:

Type checking

if <object> is <type> thenif <object> is not <type> then

Generic constraints

is is used within a where clause:

type
  MyArrayList<T> = public class(ArrayList, IPersistentCollection)
    where T is PersistentObject, T has constructor;

As well as allowing you to check for a particular type, Oxygene generics also supports 'is record' and 'is class':

type
  GenericThatOnlyTakesARecord<T> = class
  where T is record;
    FVal: T;
  public
    constructor (Val: T);
  end;

  GenericThatOnlyTakesAClass<T> = class
  where T is class;
    FVal: T;
  public
    constructor (Val: T);
  end;
'is class' means that it's not a value type/record (even though value types descend from System.Object).


See Also


Product: RemObjects Oxygene (formerly known as Chrome)
Current version: 3.0 Previous Versions: 'Joyride' (2.0), 'Floorshow' (1.5), 'Adrenochrome' (1.0)

GlossaryKeywordsLanguage FeaturesPlatform FeaturesSamplesArticlesHow ToIssues

Personal tools