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
PerlBridgedObjectand its instance contains a native Swift object which can be passed to Perl.
Making your own custom types conforming to
AnyPerlprotocol 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
PerlBridgedObjectis simple. Declare astatic var perlClassNamethat contains a name of the Perl class your Swift class should be bridged to. UseaddPerlMethodmethod on startup to provide ability to access your methods and attributes from Perl.Declaration
Swift
public protocol PerlBridgedObject : AnyPerl, PerlNamedClass, PerlScalarConvertible
View on GitHub
Protocols Reference