![Copy image Copy image](icons/copycode.gif)
![CopyHover image CopyHover image](copycodeHighlight.gif)
Swi-cs-pl - A CSharp class library to connect .NET languages with SWI-Prolog
Explicit Operator
SwiPlCs interface ► SbsSW.SwiPlCs ► PlTerm ► ExplicitNarrowingExplicitExplicitExplicit(PlTerm to Int32)
Yields a int if the PlTerm is a Prolog integer or float that can be converted
without loss to a int. Throws a PlTypeException exception otherwise
![](collapse_all.gif)
C# | Visual Basic | Visual C++ | F# |
public static explicit operator int ( PlTerm term )
Public Shared Narrowing Operator CType ( term As PlTerm ) As Integer
static explicit operator int ( PlTerm term )
F# does not support the declaration of new casting operators.
![](collapse_all.gif)
- term (PlTerm)
- A PlTerm is a Prolog integer or float that can be converted without loss to a int.
![](collapse_all.gif)
Int32
A C# int
A C# int
![](collapse_all.gif)
Exception | Condition |
---|---|
PlTypeException | Throws a PlTypeException exception if PlType
is not a PlType.PlInteger or a PlType.PlFloat. |
PreconditionException | Is thrown if the operator is used on an uninitialized PlTerm |
Assembly: SwiPlCs (Module: SwiPlCs.dll) Version: 1.1.60605.0 (1.1.60605.0)