[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/2] Add more context to E_constraint msg
From: |
Jose E. Marchesi |
Subject: |
Re: [PATCH 0/2] Add more context to E_constraint msg |
Date: |
Thu, 28 Dec 2023 19:46:21 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
>> On Thu, Dec 28, 2023 at 05:09:30PM +0100, Jose E. Marchesi wrote:
>>>
>>> s/print/format I guess.
>>>
>>> Actually, why not turning the location field in Exception from a single
>>> string to an array of strings? Then we could have a function in the
>>> runtime that builds an array from the locations stack, another function
>>> that prints the location array out, etc.
>>>
>>> Makes sense?
>>>
>>
>>
>> Perfectly!
>> I'll revise this patches to adopt the new approach.
>>
>> Do you have any comments on the current implementation?
>
> I am wondering whether it is really necessary to add a new stack to the
> PVM for this.
>
> Couldn't this be implemented using a global array in the runtime?
> Something like this in pkl-rt.pk:
>
> var _pkl_locations = _Pkl_Location[]();
>
> Then the code generator can emit apush/apop accordingly.
I mean calls to suitable functions like _pkl_push_location and
_pkl_pop_location also defined in the runtime.
>
>>
>>
>>> > Also, I think this needs more tests 8-)
>>
>>
>> Sure :)