What do you think it should do instead?

Perhaps set both slots on rectangle and then throw an error if the
predicate is invalid?

Although a better square constructor would only take one length:

: <square> ( n -- square ) dup <rectangle> ; inline





On Fri, Mar 8, 2013 at 12:26 AM, Loryn Jenkins <lor...@gmail.com> wrote:

> I was playing around with predicates today.
>
> It seems that when I attempt to run a default constructor directly on a
> predicate type, I get a macro expansion error.
>
> I quickly grepped through the codebase in basis and extras, and couldn't
> find an instance where a constructor was used off a predicate class.
>
> Can I assume that predicate types are not intended to be instantiated
> directly? Or am I assuming that erroneously?
>
>
>
> TUPLE: rectangle width height ;
> PREDICATE: square < rectangle [ width>> ] [ height>> ] bi = ;
> C: <rectangle> rectangle
> C: <square> square
> 3 3 <rectangle>
> --> 12
> 3 3 <square>
> --> The word <square> cannot be executed because it failed to compile
>
> Macro expansion of “boa” threw an error
>
> The error was:
> Assertion failed
> got    0
> expect 1
> [Traceback]
>
>
>
> ------------------------------------------------------------------------------
> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
> endpoint security space. For insight on selecting the right partner to
> tackle endpoint security challenges, access the full report.
> http://p.sf.net/sfu/symantec-dev2dev
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to