[Parrot-users] Numerical and string comparisons in Squaak (and PIR)
Jonathan Leto
jonathan at leto.net
Wed Feb 2 16:33:05 UTC 2011
Howdy,
Can you show us an example output of what strange behavior you are
seeing? A small chunk of code that exhibits what you are seeing would
be useful.
Which version of Parrot?
Duke
On Wed, Feb 2, 2011 at 3:10 AM, Fredrik Rothamel
<fredrik.rothamel at bahnhof.se> wrote:
> Hi,
>
> While tinkering with Squaak and debugging some strange behaviour I noticed
> that I get different results from the comparison ops depending on the order
> of parameters with different types.
> How do I make sure a numerical comparison is performed if at least one
> parameter is a number?
>
> "<" for example is implemented using pirop "islt PMC, PMC"
>
> How do I make "islt" use the string PMCs cmp_num method instead of the
> default cmp when the first parameter is a string and the second parameter is
> an integer?
> Do I need to inherit and modify the string PMC or are there other ways?
>
> BR,
> Fredrik
> _______________________________________________
> Parrot-users mailing list
> Parrot-users at lists.parrot.org
> http://lists.parrot.org/mailman/listinfo/parrot-users
>
--
Jonathan "Duke" Leto
jonathan at leto.net
http://leto.net
More information about the Parrot-users
mailing list