Continuing the discussion from Getting the components of a Blueprint:
To convert an object you use the conversion operator
The conversion will only be called if it is necessary, so
"AString">>String would do nothing.
SkookumSript tries to reduce typing when what you would type seems obvious and conversion calls can implicitly supply the class type if the parser can figure out the class that is desired.
Since it is obvious to the parser that a
Name class is desired, specifying that you want to convert it with
>> is sufficient enough - you don’t actually have to write out the class since the parser already knows what you want.
Conversion calls rely on the presence of conversion methods - a method with the same name as the class type to convert to.
You can also call the conversion method directly - in this example it is the
Calling the conversion method directly ensures that it is always called, so
"AString".String will call
String() even though
"AString" is already a
Sometimes classes will have constructor methods that essentially take the type that you want to convert as an argument though they are a bit longer to type - like the constructor that you started with.