Looks like we didn't handle nested local scopes properly (the ``x``
variable is in a nested scope inside the quotation, being bound to each
value the quotation is called on.

I fixed this just now:


https://github.com/factor/factor/commit/2b23d75544cdebdb8dce995c842c49daadf871a3
.

Thanks for the bug report!

Best,
John.

On Thu, Mar 16, 2017 at 12:39 PM, Alexander Ilin <ajs...@yandex.ru> wrote:

> Hello!
>
>   Does anyone know why this code generates an error?
>
> ```
> USE: infix
> ! Solve a quadratic equation in Zp by enumeration.
> :: solve-Zp* ( a b c p -- roots )
>     p iota [ :> x [infix (a*x*x + b*x + c) % p infix] 0 = ] filter ;
> ```
>
>   The error points to `infix]` with the message
>
> ```
> local is not defined
> name "a"
> ```
>
> ---=====---
>  Александр
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to