# HG changeset patch # User Paul Boddie # Date 1478021147 -3600 # Node ID e180c6a89fdf6ee44a5aeea954946d8c02f3d9ce # Parent 4b424c223b8ab3e4f19f4b0d6aeb3730d92bb1de Properly implemented the __BOOL function and the _list_nonempty native function. diff -r 4b424c223b8a -r e180c6a89fdf templates/native.c --- a/templates/native.c Tue Nov 01 18:23:42 2016 +0100 +++ b/templates/native.c Tue Nov 01 18:25:47 2016 +0100 @@ -289,8 +289,7 @@ { #define self (__args[1]) - /* NOTE: To be written. */ - return __builtins___none_None; + return __load_via_object(self.value, __pos___data__).data->size ? __builtins___boolean_True : __builtins___boolean_False; #undef self } diff -r 4b424c223b8a -r e180c6a89fdf templates/progops.c --- a/templates/progops.c Tue Nov 01 18:23:42 2016 +0100 +++ b/templates/progops.c Tue Nov 01 18:25:47 2016 +0100 @@ -7,6 +7,7 @@ #include "progconsts.h" #include "progops.h" #include "progtypes.h" +#include "main.h" #include /* Generic instantiation operations, defining common members. */ @@ -143,5 +144,9 @@ int __BOOL(__attr attr) { - return attr.value == __builtins___boolean_True.value; + __attr args[2] = {{0, 0}, attr}; + + /* Invoke the bool function with the object and test against True. */ + + return __fn___builtins___boolean_bool(args).value == __builtins___boolean_True.value; }