Judging by the patches, this was a much earlier version than I intended to
post. In the current version, min and max are now implemented, and test files
evaluate two-operand and three-operand versions. The (<>=) operands work now
with more than two operands, and I've added tests for these with three
operands.

Answering questions: Operators should now use no more than two registers at
any given time. The bug where _save returned an unused temporary has been
fixed,

As to whether we can get it into languages/scheme, I'd be pleased to add it
but I don't have CVS access. I'm also working with a patch to introduce a
'set' instruction that writes to and from a temporary memory cell.

Sam Tregar wrote:

> Here's a patch to fix logical ops in the Parrot Scheme compiler.  The
> patch:
>
>    - Implements (min) and (max) which had stubs and some =pod'd out code
>      which I couldn't understand.
>
>    - Fixes (=), (<), (>), (<=) and (>=) to work with more than 2 operands.
>      Added tests where they were missing and fixed tests that were
>      incorrectly passing.
>
> After this patch "make test" has no failures on my box.  Question:
>
>    - Why does Scheme::Generator::_save(2) return an array of three
>      elements?  I tried to "fix" _save() and that just broke things...
>      I must be missing something!
>
> -sam
> PS: Can we get this into languages/scheme?
>
>   ------------------------------------------------------------------------
>                          Name: scheme_logic.patch
>    scheme_logic.patch    Type: Plain Text (TEXT/PLAIN)
>                      Encoding: BASE64

Reply via email to