poke-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] pkl: Use `format` function in `assert` implementation


From: Jose E. Marchesi
Subject: Re: [PATCH] pkl: Use `format` function in `assert` implementation
Date: Sat, 31 Jul 2021 15:47:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi Mohammad.

Sorry it took so long for me to look at this.

> This commit changes the implementation of `assert` statement to
> pass source location info (FILENAME, LINE and COLUMN) separately,
> instead of passing a pre-formated string
> ("<FILENAME>:<LINE>:<COLUMN>"). And makes `msg` string using `format`
> function.
>
> The reason that this commit, separates the runtime library (`pkl-rt.pk`)
> into two separate files (`pkl-rt-1.pk` and `pkl-rt-2.pk`) is that
> codegen of `format` generates a function call to
> `_pkl_reduce_string_array`, and it's inaccessible to codegen at this
> stage. Because `_pkl_reduce_string_array` is also defined in the runtime
> library. Moving `_pkl_assert` function to `pkl-rt-2.pk` makes codegen
> happy!

I would like to understand why this is happening.  Moving the definition
of _pkl_assert down in pkl-rt.pk after _pkl_reduce_string_array doesn't
fix the problem?



reply via email to

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