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 /apl9.h | |
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 'apl9.h')
-rw-r--r-- | apl9.h | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -45,16 +45,14 @@ typedef enum typedef enum { - ESyntax = 1, - EParse, - EValue, - EDomain, - ERank, - EType, - ELength, - EIndex, - EShape, - ENotImplemented, + /* The numbers are the same as in dyalog */ + ESyntax = 2, + EIndex = 3, + ERank = 4, + ELength = 5, + EValue = 6, + EDomain = 11, + ENotImplemented = 100, /* not in dyalog */ } errorCodes; /* Data types */ @@ -330,6 +328,7 @@ Datum *quadnamedatum(QuadnameDef); /* error.c */ ErrorGuard *newerrorguard(Array *, Statement *); void throwerror(Rune *, int); +Rune *errorstr(int); /* inverse.c */ Function inverse(Function); @@ -479,6 +478,5 @@ extern int arrayalloccounts; /* memory.c */ extern int datumalloccounts; /* memory.c */ extern QuadnameDef quadnames[]; /* quadnames.c */ extern int printprecision; /* print.c */ -extern Rune *errorstrs[]; /* error.c */ extern int needsnewline; /* quadnames.c */ extern int mainstacksize; /* concurrency.c */
\ No newline at end of file |