File: overload.g

package info (click to toggle)
gap-scscp 2.4.3%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,704 kB
  • sloc: xml: 1,231; sh: 406; makefile: 19
file content (32 lines) | stat: -rw-r--r-- 1,183 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#############################################################################
#
# This file demonstrates how remote objects may be treated 
# in a uniform way with local objects
#
#############################################################################
 

#############################################################################
##
#M  \*( <x>, <y> )  . . . .  remote multiplication for two remote objects
##                           located on the same server 
## Example:
## gap> a:=StoreAsRemoteObject(6,"localhost",26133);
## < remote object scscp://localhost:26133/TEMPVarSCSCPRzYq748N >
## gap> b:=StoreAsRemoteObject(7,"localhost",26133);
## < remote object scscp://localhost:26133/TEMPVarSCSCPyYLzK5vW >
## gap> a*b;
## < remote object scscp://localhost:26133/TEMPVarSCSCPDalMjf4H >
## gap> RetrieveRemoteObject(last);
## 42
##
InstallOtherMethod( \*,
    "for two remote objects",
    IsIdenticalObj,
    [ IsRemoteObject, IsRemoteObject ],
    function( x, y )
    if x![2]<>y![2] or x![3]<>y![3] then
      Error("Remote objects located in different places\n");
    fi;
    return EvaluateBySCSCP("WS_Mult",[x,y],x![2],x![3]:output:="cookie").object;
    end);