Newbie questions about Pliant

Newbie questions about Pliant

identifier naming convention

Pliant identifiers can use any character, so a convention appears to be necessary to keep homogene all theese identifiers.
Message posted by johan.boule on 2001/01/26 22:07:46
In the pliant PDEE, I can see identifiers like
    '. xxx'
    'cast Xxx'
    'to string' (method)
    'from string' (method)
    'the object' (in "/pliant/language/data/fields.pli")
    DualKeyword (Type)
    dual_keyword (meta)
As I understand, defining a meta my_object my_method will be converted to the definition of a function '. my_method' my_object
Why is there no cast meta do define casting functions ?
Are the 'cast Xxx' identifers special like the '. xxx' ones ?

Are the underscore and space chars "forbidden" in identifers that represent a type ?

Shouldn't upper case letters and spaces be "forbidden" in identifiers that aren't types ?
(and thus the 'the object', 'to string' and 'from string' identifiers should be deprecated names)
Message posted by johan.boule on 2001/01/26 22:10:29
Does the "?" is a special ident ?
Message posted by johan.boule on 2001/01/26 22:12:34
@(#! Please be indulgent for my poor English !
I meant: Is the "?" ident a special one ?
Message posted by hubert.tonneau on 2001/01/27 00:52:47

In Pliant, and identifier can be anything. If it starts with a letter, and contains only letters, digits or underscores, then you don't need to put quotes around. If it contains other characters, then the quotes are required.
The general idea is that I use spaces in some indentifiers in order to avoid name clashes (with local variables that should never use special characters, and with local functions).

Are the 'cast Xxx' identifers special like the '. xxx' ones ?

Yes. The Pliant casting mechanism is something very complexe because several casting instructions can be applyed. As an example, if the function want's an 'Intn' and we receive an 'Int8' then the following will be applyed:
Int8 -> Int -> Intn
The name of the casting function is constrained so that Pliant engine can resonably fast decide what the right casting sequence is.

The '?' is an operator defined in module /pliant/language/debug/error2.pli and it says, if there is a pending error, then exit the current function.