enhanced the compiler to implement short-circuited logical 'and' and 'or' special forms.

renamed the primitive function 'and' to '_and' and 'or' to '_or'
This commit is contained in:
2018-03-03 17:16:41 +00:00
parent c387772803
commit 71d024837d
3 changed files with 218 additions and 6 deletions

View File

@ -417,8 +417,8 @@ static pf_t builtin_prims[] =
{ 0, 0, pf_gc, 2, { 'g','c' } },
{ 1, 1, pf_not, 3, { 'n','o','t' } },
{ 2, HCL_TYPE_MAX(hcl_oow_t), pf_and, 3, { 'a','n','d' } },
{ 2, HCL_TYPE_MAX(hcl_oow_t), pf_or, 2, { 'o','r' } },
{ 2, HCL_TYPE_MAX(hcl_oow_t), pf_and, 4, { '_','a','n','d' } },
{ 2, HCL_TYPE_MAX(hcl_oow_t), pf_or, 3, { '_','o','r' } },
{ 2, 2, pf_eqv, 4, { 'e','q','v','?' } },
{ 2, 2, pf_eql, 4, { 'e','q','l','?' } },