Protocols
The following protocols are available globally.
-
A type that represents any Perl variable.
There are two major cases when some class conforms to this protocol:
- An instance of a class contains a native Perl variable (some
SV
). In this case it is derived fromPerlObject
. - A class conforms to
PerlBridgedObject
and its instance contains a native Swift object which can be passed to Perl.
Making your own custom types conforming to
AnyPerl
protocol is undesirable.Declaration
Swift
public protocol AnyPerl : class
- An instance of a class contains a native Perl variable (some
-
A class having Perl representation.
See moreDeclaration
Swift
public protocol PerlNamedClass : class
-
A Swift class which instances can be passed to Perl as a blessed SV.
Implementing an object that conforms to
PerlBridgedObject
is simple. Declare astatic var perlClassName
that contains a name of the Perl class your Swift class should be bridged to. UseaddPerlMethod
method on startup to provide ability to access your methods and attributes from Perl.Declaration
Swift
public protocol PerlBridgedObject : AnyPerl, PerlNamedClass, PerlScalarConvertible