Is there a bug in 'any' function?

7 views
Skip to first unread message

chrisichris

unread,
Mar 7, 2012, 12:09:27 PM3/7/12
to yeti-lang
Hi

Using any with curried function gives other result than with do ..
done:

> (any do n: strStarts? "favicon.ico" n done ["favicon.ico"])
true is boolean
> (any (strStarts? "favicon.ico") ["favicon.ico"])
false is boolean

I don't see what is here the difference. Is this a bug?

Chris

Jean-Francois Poilpret

unread,
Mar 8, 2012, 8:05:28 AM3/8/12
to yeti...@googlegroups.com
It seems to be a bug with strStarts?, not any:
 
> f = strStarts? "aa"
f is string -> boolean = <yeti.lang.std$strStarts$q>
> f "aa"
<yeti.lang.Fun2_> is boolean
 
Actually, f "aa" should be just:
true is boolean
Honestly, I don't understand Yeti message here.
 
Jean-François

chrisichris

unread,
Mar 8, 2012, 11:49:38 AM3/8/12
to yeti-lang
Yes seems so - thx


On 8 Mrz., 14:05, Jean-Francois Poilpret <jfpoilp...@gmail.com> wrote:
> It seems to be a bug with strStarts?, not any:
>
> > f = strStarts? "aa"
>
> f is string -> boolean = <yeti.lang.std$strStarts$q>> f "aa"
>
> <yeti.lang.Fun2_> is boolean
>
> Actually, f "aa" should be just:
> true is boolean
> Honestly, I don't understand Yeti message here.
>
> Jean-François
>

Madis

unread,
Mar 8, 2012, 12:55:49 PM3/8/12
to yeti-lang

On Thu, 8 Mar 2012, chrisichris wrote:

> Yes seems so - thx
>
> On 8 Mrz., 14:05, Jean-Francois Poilpret <jfpoilp...@gmail.com> wrote:
>> It seems to be a bug with strStarts?, not any:
>>
>>> f = strStarts? "aa"

str* functions use inbuilt special implementation that inlines the
application into String.method call, when all arguments are applied. There
was off-by-one error when partial application was done, so first argument
got ignored. This should be fixed now in master branch and snapshot build.

>> f is string -> boolean = <yeti.lang.std$strStarts$q>> f "aa"
>>
>> <yeti.lang.Fun2_> is boolean
>>
>> Actually, f "aa" should be just:
>> true is boolean
>> Honestly, I don't understand Yeti message here.
>>

>> Jean-Fran�ois

chrisichris

unread,
Mar 9, 2012, 2:38:41 AM3/9/12
to yeti-lang
Hi,

Thanks for the fix. I have uploaded the 0.9.4+-SNAPSHOT version to my
mvn-repo ( http://chrisichris.github.com/chrisis-maven-repo/snapshots
) .

Chris

On 8 Mrz., 18:55, Madis <ma...@cyber.ee> wrote:
> On Thu, 8 Mar 2012, chrisichris wrote:
> > Yes seems so - thx
>
> > On 8 Mrz., 14:05, Jean-Francois Poilpret <jfpoilp...@gmail.com> wrote:
> >> It seems to be a bug with strStarts?, not any:
>
> >>> f = strStarts? "aa"
>
> str* functions use inbuilt special implementation that inlines the
> application into String.method call, when all arguments are applied. There
> was off-by-one error when partial application was done, so first argument
> got ignored. This should be fixed now in master branch and snapshot build.
>
>
>
>
>
>
>
> >> f is string -> boolean = <yeti.lang.std$strStarts$q>> f "aa"
>
> >> <yeti.lang.Fun2_> is boolean
>
> >> Actually, f "aa" should be just:
> >> true is boolean
> >> Honestly, I don't understand Yeti message here.
>
> >> Jean-Fran�ois
Reply all
Reply to author
Forward
0 new messages