aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/interp/define.boot34
-rw-r--r--src/share/algebra/browse.daase2
-rw-r--r--src/share/algebra/category.daase2
-rw-r--r--src/share/algebra/compress.daase2
-rw-r--r--src/share/algebra/interp.daase2
-rw-r--r--src/share/algebra/operation.daase2
7 files changed, 26 insertions, 25 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2736834b..7e6701ed 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2011-10-21 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * interp/define.boot (compDefineCapsuleFunction): Reimplement
+ signature inference.
+ (hasSigInTargetCategory): Implement what the documentation says:
+ infer the signature from the target category, not local declaration.
+
2011-10-20 Gabriel Dos Reis <gdr@cs.tamu.edu>
* interp/define.boot (checkRepresentation): Prepare for general
diff --git a/src/interp/define.boot b/src/interp/define.boot
index 8ccaddec..23d92eb1 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -1721,20 +1721,18 @@ compDefineCapsuleFunction(df is ['DEF,form,signature,body],
$formalArgList:= [:argl,:$formalArgList]
--let target and local signatures help determine modes of arguments
- argModeList :=
- identSig := hasSigInTargetCategory(argl,form,signature.target,e) =>
- (e:= checkAndDeclare(argl,form,identSig,e); identSig.source)
- [getArgumentModeOrMoan(a,form,e) for a in argl]
- argModeList := stripOffSubdomainConditions(argModeList,argl)
- signature' := [signature.target,:argModeList]
- if null identSig then --make $op a local function
- $e := put($op,'mode,['Mapping,:signature'],$e)
+ signature' :=
+ sig := hasSigInTargetCategory(argl,form,signature.target,e) => sig
+ sig := getSignatureFromMode(form,e) => sig
+ [signature.target,:[getArgumentModeOrMoan(a,form,e) for a in argl]]
+ signature'.source := stripOffSubdomainConditions(signature'.source,argl)
--obtain target type if not given
- if null signature'.target then signature':=
- identSig => identSig
- getSignature($op,signature'.source,e) or return nil
- e:= giveFormalParametersValues(argl,e)
+ if signature'.target = nil then
+ signature'.target :=
+ getSignature($op,signature'.source,e).target or return nil
+ e := checkAndDeclare(argl,form,sig,e)
+ e := giveFormalParametersValues(argl,e)
$signatureOfForm:= signature' --this global is bound in compCapsuleItems
$functionLocations := [[[$op,$signatureOfForm]],:$functionLocations]
@@ -1851,14 +1849,10 @@ hasSigInTargetCategory(argl,form,opsig,e) ==
fn(sig,opsig,mList) ==
(null opsig or opsig=sig.target) and
(and/[compareMode2Arg(x,m) for x in mList for m in sig.source])
- c:= #potentialSigList
- 1=c => first potentialSigList
- --accept only those signatures op right length which match declared modes
- 0=c => (#(sig:= getSignatureFromMode(form,e))=#form => sig; nil)
- 1<c =>
- ambiguousSignatureError($op,potentialSigList)
- first potentialSigList
- nil --this branch will force all arguments to be declared
+ potentialSigList is [sig] => sig
+ potentialSigList = nil => nil
+ ambiguousSignatureError($op,potentialSigList)
+ first potentialSigList
compareMode2Arg(x,m) == null x or modeEqual(x,m)
diff --git a/src/share/algebra/browse.daase b/src/share/algebra/browse.daase
index 353527d1..ff686828 100644
--- a/src/share/algebra/browse.daase
+++ b/src/share/algebra/browse.daase
@@ -1,5 +1,5 @@
-(2004998 . 3528046424)
+(2004998 . 3528172868)
(-18 A S)
((|constructor| (NIL "One-dimensional-array aggregates serves as models for one-dimensional arrays. Categorically,{} these aggregates are finite linear aggregates with the \\spadatt{shallowlyMutable} property,{} that is,{} any component of the array may be changed without affecting the identity of the overall array. Array data structures are typically represented by a fixed area in storage and therefore cannot efficiently grow or shrink on demand as can list structures (see however \\spadtype{FlexibleArray} for a data structure which is a cross between a list and an array). Iteration over,{} and access to,{} elements of arrays is extremely fast (and often can be optimized to open-code). Insertion and deletion however is generally slow since an entirely new data structure must be created for the result.")))
NIL
diff --git a/src/share/algebra/category.daase b/src/share/algebra/category.daase
index f070e538..0a0d8406 100644
--- a/src/share/algebra/category.daase
+++ b/src/share/algebra/category.daase
@@ -1,5 +1,5 @@
-(198618 . 3528046427)
+(198618 . 3528172871)
((((-765)) . T))
((((-765)) . T))
((((-765)) . T))
diff --git a/src/share/algebra/compress.daase b/src/share/algebra/compress.daase
index db33a4cb..ab447b8b 100644
--- a/src/share/algebra/compress.daase
+++ b/src/share/algebra/compress.daase
@@ -1,5 +1,5 @@
-(30 . 3528046424)
+(30 . 3528172867)
(3982 |Enumeration| |Mapping| |Record| |Union| |ofCategory| |isDomain|
ATTRIBUTE |package| |domain| |category| CATEGORY |nobranch| AND |Join|
|ofType| SIGNATURE "failed" "algebra" |OneDimensionalArrayAggregate&|
diff --git a/src/share/algebra/interp.daase b/src/share/algebra/interp.daase
index 8bc3dd88..5c8f969a 100644
--- a/src/share/algebra/interp.daase
+++ b/src/share/algebra/interp.daase
@@ -1,5 +1,5 @@
-(2797332 . 3528046432)
+(2797332 . 3528172878)
((-1719 (((-83) (-1 (-83) |#2| |#2|) $) 86 T ELT) (((-83) $) NIL T ELT)) (-1717 (($ (-1 (-83) |#2| |#2|) $) 18 T ELT) (($ $) NIL T ELT)) (-3772 ((|#2| $ (-478) |#2|) NIL T ELT) ((|#2| $ (-1135 (-478)) |#2|) 44 T ELT)) (-2283 (($ $) 80 T ELT)) (-3826 ((|#2| (-1 |#2| |#2| |#2|) $ |#2| |#2|) 52 T ELT) ((|#2| (-1 |#2| |#2| |#2|) $ |#2|) 50 T ELT) ((|#2| (-1 |#2| |#2| |#2|) $) 49 T ELT)) (-3403 (((-478) (-1 (-83) |#2|) $) 27 T ELT) (((-478) |#2| $) NIL T ELT) (((-478) |#2| $ (-478)) 96 T ELT)) (-2873 (((-578 |#2|) $) 13 T ELT)) (-3502 (($ (-1 (-83) |#2| |#2|) $ $) 64 T ELT) (($ $ $) NIL T ELT)) (-1936 (($ (-1 |#2| |#2|) $) 37 T ELT)) (-3942 (($ (-1 |#2| |#2|) $) NIL T ELT) (($ (-1 |#2| |#2| |#2|) $ $) 60 T ELT)) (-2290 (($ |#2| $ (-478)) NIL T ELT) (($ $ $ (-478)) 67 T ELT)) (-1341 (((-3 |#2| "failed") (-1 (-83) |#2|) $) 29 T ELT)) (-1934 (((-83) (-1 (-83) |#2|) $) 23 T ELT)) (-3784 ((|#2| $ (-478) |#2|) NIL T ELT) ((|#2| $ (-478)) NIL T ELT) (($ $ (-1135 (-478))) 66 T ELT)) (-2291 (($ $ (-478)) 76 T ELT) (($ $ (-1135 (-478))) 75 T ELT)) (-1933 (((-687) (-1 (-83) |#2|) $) 34 T ELT) (((-687) |#2| $) NIL T ELT)) (-1718 (($ $ $ (-478)) 69 T ELT)) (-3384 (($ $) 68 T ELT)) (-3514 (($ (-578 |#2|)) 73 T ELT)) (-3786 (($ $ |#2|) NIL T ELT) (($ |#2| $) NIL T ELT) (($ $ $) 87 T ELT) (($ (-578 $)) 85 T ELT)) (-3930 (((-765) $) 92 T ELT)) (-1935 (((-83) (-1 (-83) |#2|) $) 22 T ELT)) (-3040 (((-83) $ $) 95 T ELT)) (-2669 (((-83) $ $) 99 T ELT)))
(((-18 |#1| |#2|) (-10 -7 (-15 -3040 ((-83) |#1| |#1|)) (-15 -3930 ((-765) |#1|)) (-15 -2669 ((-83) |#1| |#1|)) (-15 -1717 (|#1| |#1|)) (-15 -1717 (|#1| (-1 (-83) |#2| |#2|) |#1|)) (-15 -2283 (|#1| |#1|)) (-15 -1718 (|#1| |#1| |#1| (-478))) (-15 -1719 ((-83) |#1|)) (-15 -3502 (|#1| |#1| |#1|)) (-15 -3403 ((-478) |#2| |#1| (-478))) (-15 -3403 ((-478) |#2| |#1|)) (-15 -3403 ((-478) (-1 (-83) |#2|) |#1|)) (-15 -1719 ((-83) (-1 (-83) |#2| |#2|) |#1|)) (-15 -3502 (|#1| (-1 (-83) |#2| |#2|) |#1| |#1|)) (-15 -3772 (|#2| |#1| (-1135 (-478)) |#2|)) (-15 -2290 (|#1| |#1| |#1| (-478))) (-15 -2290 (|#1| |#2| |#1| (-478))) (-15 -2291 (|#1| |#1| (-1135 (-478)))) (-15 -2291 (|#1| |#1| (-478))) (-15 -3942 (|#1| (-1 |#2| |#2| |#2|) |#1| |#1|)) (-15 -3786 (|#1| (-578 |#1|))) (-15 -3786 (|#1| |#1| |#1|)) (-15 -3786 (|#1| |#2| |#1|)) (-15 -3786 (|#1| |#1| |#2|)) (-15 -3784 (|#1| |#1| (-1135 (-478)))) (-15 -3514 (|#1| (-578 |#2|))) (-15 -1341 ((-3 |#2| "failed") (-1 (-83) |#2|) |#1|)) (-15 -3826 (|#2| (-1 |#2| |#2| |#2|) |#1|)) (-15 -3826 (|#2| (-1 |#2| |#2| |#2|) |#1| |#2|)) (-15 -3826 (|#2| (-1 |#2| |#2| |#2|) |#1| |#2| |#2|)) (-15 -3784 (|#2| |#1| (-478))) (-15 -3784 (|#2| |#1| (-478) |#2|)) (-15 -3772 (|#2| |#1| (-478) |#2|)) (-15 -1933 ((-687) |#2| |#1|)) (-15 -2873 ((-578 |#2|) |#1|)) (-15 -1933 ((-687) (-1 (-83) |#2|) |#1|)) (-15 -1934 ((-83) (-1 (-83) |#2|) |#1|)) (-15 -1935 ((-83) (-1 (-83) |#2|) |#1|)) (-15 -1936 (|#1| (-1 |#2| |#2|) |#1|)) (-15 -3942 (|#1| (-1 |#2| |#2|) |#1|)) (-15 -3384 (|#1| |#1|))) (-19 |#2|) (-1118)) (T -18))
NIL
diff --git a/src/share/algebra/operation.daase b/src/share/algebra/operation.daase
index ee5d52c3..bf7cd788 100644
--- a/src/share/algebra/operation.daase
+++ b/src/share/algebra/operation.daase
@@ -1,5 +1,5 @@
-(630398 . 3528046425)
+(630398 . 3528172869)
(((*1 *2 *3 *4)
(|partial| -12 (-5 *3 (-1168 *4)) (-4 *4 (-13 (-954) (-575 (-478))))
(-5 *2 (-1168 (-343 (-478)))) (-5 *1 (-1197 *4)))))