Macaulay2 » Documentation
Packages » SCSCP :: SCSCPConnection <== Thing
next | previous | forward | backward | up | index | toc

SCSCPConnection <== Thing -- Execute computations using SCSCP

Synopsis

Description

As an example, we connect to a locally running SCSCP server:
i1 : s = newConnection("127.0.0.1", 26135)

o1 = SCSCP Connection to GAP (4.dev) on 127.0.0.1:26135

o1 : SCSCPConnection
i2 : s( (hold 2) + 3)

o2 = 5
i3 : close s
i4 : 
We could also explicitly have a look at the OpenMath that's being passed around
i1 : s = newConnection("127.0.0.1", 26135)

o1 = SCSCP Connection to GAP (4.dev) on 127.0.0.1:26135

o1 : SCSCPConnection
i2 : o = openMath ( (hold 2) + 3 )

o2 = <OMA
       <OMS cd="arith1" name="plus"
       <OMI "2"
       <OMI "3"

o2 : XMLnode
i3 : s(o)

o3 = <OMOBJ
       <OMATTR
         <OMATP
           <OMS cd="scscp1" name="call_id"
           <OMSTR "1"
         <OMA
           <OMS cd="scscp1" name="procedure_completed"
           <OMI "5"

o3 : XMLnode
i4 : value oo

o4 = 5
i5 : close s
i6 : 
Another syntax offered is using the <== and <=== operators. The first of these denotes a computation that returns the computed object, whereas the second denotes a computation that returns a reference (i.e. a remote object). Fortunately, these operators have lower parsing precedence than most others, so few parentheses will be required.
i1 : s = newConnection("127.0.0.1", 26136)

o1 = SCSCP Connection to Magma (0.3.0) on 127.0.0.1:26136

o1 : SCSCPConnection
i2 : s <== (hold 2)^32

o2 = 4294967296
i3 : s <=== (hold 2)^333

o3 = << Remote Magma object >>

o3 : RemoteObject
i4 : 2^301

o4 = 4074071952668972172536891376818756322102936787331872501272280898708762599526673412366794752
i5 : s <== o3/o4

o5 = 4294967296

o5 : QQ
i6 : close s
i7 : 

See also

Ways to use this method: