poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] libpoke/pkl-rt.pk: Fix condition arg of `_pkl_assert`


From: Jose E. Marchesi
Subject: Re: [PATCH] libpoke/pkl-rt.pk: Fix condition arg of `_pkl_assert`
Date: Fri, 18 Dec 2020 11:54:42 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> 2020-12-18  Mohammad-Reza Nabipoor  <m.nabipoor@yahoo.com>
>
>       * libpoke/pkl-rt.pk (_pkl_assert): Change `uint<64>` to `int<32>`
>       for condition argument. Booleans are expected to `int<32>` in
>       Poke.

I don't think this change should be done.  _pkl_assert is used to
implement the `assert' statement, and it should cover all integral
types.  uint<64> is just fine.

> ---
>  ChangeLog         | 5 +++++
>  libpoke/pkl-rt.pk | 2 +-
>  2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/ChangeLog b/ChangeLog
> index 8878ea88..d487c941 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,8 @@
> +2020-12-18  Mohammad-Reza Nabipoor  <m.nabipoor@yahoo.com>
> +
> +     * libpoke/pkl-rt.pk (_pkl_assert): Change `uint<64>` to `int<32>`
> +     for condition. Booleans are expected to `int<32>` in Poke.
> +
>  2020-12-18  Mohammad-Reza Nabipoor  <m.nabipoor@yahoo.com>
>  
>       * poke/poke.c (parse_args_2): Go to `exit_failure` when
> diff --git a/libpoke/pkl-rt.pk b/libpoke/pkl-rt.pk
> index 046376fc..b24eddd9 100644
> --- a/libpoke/pkl-rt.pk
> +++ b/libpoke/pkl-rt.pk
> @@ -163,7 +163,7 @@ fun _pkl_exception_handler = (Exception exception) 
> int<32>:
>     of the assert statement formatted like "<FILENAME>:<LINE>:<COLUMN>".
>     */
>  
> -fun _pkl_assert = (uint<64> cond, string msg, string lineinfo) void:
> +fun _pkl_assert = (int<32> cond, string msg, string lineinfo) void:
>    {
>      if (cond)
>        return;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]