Re: Documentaion update request for "find"

new topic     » goto parent     » topic index » view thread      » older message » newer message
alanjohnoxley said...

"find" is working as designed; for the multi-dimentional find I would need to write my own routine that would return a sequence of nesting level and position.

Regards,
Alan

SPringle said...

Buried in the documentation there is a find like function that does what you want in the standard library but I cannot remember its name or in which include file it is. We will be adding a table to help alleviate this problem. in the meantime, you might look at: w32findKey from the win32lib wrapper.

Yes, it is in std/search.e - find_nested() will do what is wanted.

alanjohnoxley said...

How about "find" returning -1 if the searched sequence is not one-dimentional?

Regards,
Alan

No. Sometimes I want to do,

find("needle", {"a", "needle", "in", "a", "haystack"})

or even,

find("needle", {'a', "needle", {"in"}, "a", {"h", "aystack"})

find() works correctly with nested sequences. It just works differently than find_nested().

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

Search



Quick Links

User menu

Not signed in.

Misc Menu