RE: match() (not short, he he)

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hello again Kat,


>Kat wrote:
>match("b",{{"a","b","c"}}) -- 0  
>There you simply have it nested too deeply. And you know that.
>

Yes i know that and you know that, but the language doesnt.

It doesnt matter how deeply you nest something, the
language has to have a way of conveying the result to the
program that makes sense for ALL possible cases, not just
some...

i=match("b","abc"}}) -- ret 2
i=match("b",{"a","b","c"}) --ret 2
i=match("b",{{"a","b","c"}}) --ret 2
i=match("b",{{{"a","b","c"}}}) --ret 2

Is this what you would like to see??
or
are you saying you only want to see this:

i=match("b","abc"}}) -- ret 2
i=match("b",{"a","b","c"}) --ret 2
i=match("b",{{"a","b","c"}}) --ret 0
i=match("b",{{{"a","b","c"}}}) --ret 0

??


You really have to stick your result into some code
to find out what really happens next, once you 
think you have determined a better return result.
Set i equal to whatever you think it should be for
several cases and see what happens.

Take care,
Al

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu