[% setvar title Suggested isa() operator. %]

This file is part of the Perl 6 Archive

Note: these documents may be out of date. Do not use as reference!

To see what is currently happening visit http://www.perl6.org/

TITLE

Suggested isa() operator.

VERSION

  Maintainer: James Mastros <james@rtweb.net>
  Date: 8 Aug 2000
  Mailing List: perl6-language@perl.org
  Number: 77
  Version: 1
  Status: Developing

ABSTRACT

Currently, there is no way to determine if a scalar holds something that could validly form a number/Boolean/etc. This RFC seeks to remedy that.

DESCRIPTION

The suggested semantics of the isa operator are as follows:

This is incompatible with UNIVERSAL::isa() in one case: if $obj is a string containing the name of a package, the current UNIVERSAL::isa($obj, $type) will do what the proposed isa(bless(\0, $obj), $type) would do.

This, fortunately, would not be automatically convertible. Therefore, it might be better to have the existing semantics apply to isa($obj, $type) when $obj holds the name of an existing package. Unfortunately, this means that you cannot apply isa() to arbitrary strings in absolute safety. FIXME.

IMPLEMENTATION

Hmm, it's natively (and na´vetÚ) recursive.

UNRESOLVED ISSUES

m/FIXME/.

REFERENCES

UNIVERSAL for UNIVERSAL::isa compatibility ref