Re: [fricas-devel] two argument error function

2024-04-03 Thread Ralf Hemmecke
On 4/3/24 19:48, Waldek Hebisch wrote: Yes. However, here there is question of tracking values. If you give types you should do x : T := v and not x : T ... x := v OK. I think you mentioned some time ago that in SPAD writing x:T basically means "assigning a

Re: [fricas-devel] two argument error function

2024-04-03 Thread Waldek Hebisch
On Wed, Apr 03, 2024 at 07:09:41PM +0200, Ralf Hemmecke wrote: > On 4/3/24 18:41, Waldek Hebisch wrote: > > Well, AFAICS this is one of limitations of current compiler: 'error' > > gets special treatment, but only when it is translated to Boot > > function called 'error'. If you rename 'error3'

Re: [fricas-devel] two argument error function

2024-04-03 Thread Ralf Hemmecke
On 4/3/24 18:41, Waldek Hebisch wrote: Well, AFAICS this is one of limitations of current compiler: 'error' gets special treatment, but only when it is translated to Boot function called 'error'. If you rename 'error3' to 'error', then the file will compile. But I expect that such rename will

Re: [fricas-devel] two argument error function

2024-04-03 Thread Waldek Hebisch
On Wed, Apr 03, 2024 at 05:19:03PM +0200, Ralf Hemmecke wrote: > Hi Waldek, > > I've now tried to compile all of FriCAS with your patch (adding the error3 > function to g-error.boot). > > https://github.com/fricas/fricas/compare/master...hemmecke:fricas:wip/error3.patch > > Branch "wip/error3"

Re: [fricas-devel] two argument error function

2024-04-03 Thread Waldek Hebisch
On Wed, Apr 03, 2024 at 05:19:03PM +0200, Ralf Hemmecke wrote: > Hi Waldek, > > I've now tried to compile all of FriCAS with your patch (adding the error3 > function to g-error.boot). > > https://github.com/fricas/fricas/compare/master...hemmecke:fricas:wip/error3.patch > > Branch "wip/error3"

Re: [fricas-devel] two argument error function

2024-04-03 Thread Ralf Hemmecke
Hi Waldek, I've now tried to compile all of FriCAS with your patch (adding the error3 function to g-error.boot). https://github.com/fricas/fricas/compare/master...hemmecke:fricas:wip/error3.patch Branch "wip/error3" at my github repo: https://github.com/hemmecke/fricas/tree/wip/error3 It

Re: [fricas-devel] two argument error function

2024-04-01 Thread Ralf Hemmecke
On 4/1/24 00:27, Waldek Hebisch wrote: I also saw that it might be possible that fun and/or con could be NIL. I do not yet see where that could happen, but maybe for those cases the code of error3 should be different. Well, the patch is just proof of concept. There are corner cases which

Re: [fricas-devel] two argument error function

2024-03-31 Thread Waldek Hebisch
On Sun, Mar 31, 2024 at 10:46:34PM +0200, Ralf Hemmecke wrote: > Hello Waldek, > > > Attached is a little patch which changes error function to > > 'error3' and adds two extra paramters, that is constructor name > > and function name. > > > > You need to add definition of 'error3', for example:

Re: [fricas-devel] two argument error function

2024-03-31 Thread Ralf Hemmecke
Hello Waldek, Attached is a little patch which changes error function to 'error3' and adds two extra paramters, that is constructor name and function name. You need to add definition of 'error3', for example: error3(con, fun, mess) == errorSupervisor($AlgebraError, [STRCONC(con, '"$",

Re: [fricas-devel] two argument error function

2024-03-30 Thread Waldek Hebisch
On Sat, Mar 30, 2024 at 10:31:46PM +0100, Ralf Hemmecke wrote: > On 3/30/24 00:43, Waldek Hebisch wrote: > > Compiler knows function name and constructor name. Note however > > that FriCAS types are parametrized, and type parameter are known > > only at runtime. > > Waldek, that sounds as if

Re: [fricas-devel] two argument error function

2024-03-30 Thread Ralf Hemmecke
On 3/30/24 00:43, Waldek Hebisch wrote: Compiler knows function name and constructor name. Note however that FriCAS types are parametrized, and type parameter are known only at runtime. Waldek, that sounds as if printing function and constructor name would be quite easy to achieve. Yes,

Re: [fricas-devel] two argument error function

2024-03-29 Thread Waldek Hebisch
On Fri, Mar 29, 2024 at 11:24:59AM +1100, Hill Strong wrote: > On Thu, Mar 28, 2024 at 6:02 PM Ralf Hemmecke wrote: > > > > > > > OK the answer to the above is not soo important to me, but I think Greg > > is right that the builtin 'error' should automatically show the function > > name in which

Re: [fricas-devel] two argument error function

2024-03-28 Thread Hill Strong
On Thu, Mar 28, 2024 at 6:02 PM Ralf Hemmecke wrote: > > > OK the answer to the above is not soo important to me, but I think Greg > is right that the builtin 'error' should automatically show the function > name in which it is called. Doesn't the compiler have all this information? > > Such an

Re: [fricas-devel] two argument error function

2024-03-28 Thread Ralf Hemmecke
On 3/28/24 03:55, Waldek Hebisch wrote: On Thu, Mar 28, 2024 at 03:15:46AM +0100, Ralf Hemmecke wrote: That is easy, we have things like error "makeSketch: constant polynomial" That is, include function name as part of error message. We should, maybe, more often use the two argument error

Re: [fricas-devel] two argument error function

2024-03-27 Thread Waldek Hebisch
On Thu, Mar 28, 2024 at 03:15:46AM +0100, Ralf Hemmecke wrote: > > That is easy, we have things like > > > > error "makeSketch: constant polynomial" > > > > That is, include function name as part of error message. > > We should, maybe, more often use the two argument error function. > >

[fricas-devel] two argument error function

2024-03-27 Thread Ralf Hemmecke
That is easy, we have things like error "makeSketch: constant polynomial" That is, include function name as part of error message. We should, maybe, more often use the two argument error function. https://github.com/fricas/fricas/blob/master/src/algebra/error.spad#L47 Ralf -- You