diff options
author | Peter Mikkelsen <peter@pmikkelsen.com> | 2022-02-22 21:25:36 +0000 |
---|---|---|
committer | Peter Mikkelsen <peter@pmikkelsen.com> | 2022-02-22 21:25:36 +0000 |
commit | 40af1deff9db7b86532db6957ebdbc0aaff38db1 (patch) | |
tree | cb417113744f26a015d36ee6732746c4e808e700 /hybrids.c | |
parent | ae6471f1c94f51df540d95edc09c7749002f44e8 (diff) |
Make errors more like dyalog:
* Use the same error numbers
* Rename ⎕THROW to ⎕SIGNAL
* Implement ⎕EN to inspect the last error code
* Implement ⎕EM to get a message from an error code
Diffstat (limited to 'hybrids.c')
-rw-r--r-- | hybrids.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -37,7 +37,7 @@ Array * fnReplicateFirst(Array *left, Array *right) { if(GetType(left) != AtypeInt) - throwerror(nil, EType); + throwerror(nil, EDomain); if(GetRank(left) > 1) throwerror(nil, ERank); @@ -107,7 +107,7 @@ Array * fnExpandFirst(Array *left, Array *right) { if(GetType(left) != AtypeInt) - throwerror(nil, EType); + throwerror(nil, EDomain); if(GetRank(left) > 1) throwerror(nil, ERank); @@ -193,12 +193,12 @@ opReduceFirst(Datum *lefto, Array *left, Array *right) { if(left){ if(GetType(left) != AtypeInt) - throwerror(nil, EType); + throwerror(nil, EDomain); if(GetSize(left) != 1) throwerror(nil, ELength); vlong winsize = left->intdata[0]; if(winsize > right->shape[0]) - throwerror(nil, EShape); + throwerror(nil, ELength); Rune *code = L"n←(-|⍺)+1+≢⍵ ⋄" L"ix←(⍳|⍺)∘+¨(⍳n)-⎕io ⋄" |