From 40af1deff9db7b86532db6957ebdbc0aaff38db1 Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Tue, 22 Feb 2022 21:25:36 +0000 Subject: Make errors more like dyalog: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- hybrids.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'hybrids.c') diff --git a/hybrids.c b/hybrids.c index 2a6b9b5..243faa4 100644 --- a/hybrids.c +++ b/hybrids.c @@ -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 ⋄" -- cgit v1.2.3