[PATCH RFC v3] algol68: Add allocation function for leaf objects
Pietro Monteiro
pietro@sociotechnical.xyz
Wed Jan 14 21:33:25 GMT 2026
On Wed, Jan 14, 2026, at 4:06 PM, Jose E. Marchesi wrote:
>> It still feels weird to pass a MOID_T and a tree to
>> a68_lower_malloc. :P
>
> :)
>
> Just a little thing:
>
>> +#define LEAF_P(m) (!IS_REF (m) && !HAS_ROWS (m))
>
> I think it would be better to call that macro IS_LEAF. It matches
> better with the current style.
>
> This looks very good!
> Does it work? :)
All tests pass on x64_64 with and without "-m32" ;)
I took another look at the the front end code and I think I'll add a is_leaf function that:
If the mode is REF, FLEX or ROW: returns false. This is pretty much the current macro.
And also if the mode is STRUCT or UNION: return false if any mode in the PACK_T chain is not leaf, else true.
Return true otherwise.
WDYT?
pietro
More information about the Algol68
mailing list