>If you use delimiter names that are speaking, it would get very readable:
>
>  define delimiter pathItem as "/"
>  define delimiter fileSuffixItem as "."
>
>  put the last fileSuffixItem of the last pathItem of theFile into theSuffix

Ruediger,

 We could auto-append "item" to every chunk type that is user-defined, but
I think that's be a bit too restrictive. But we might make that a
guideline: "Name all your delimiters "*_Item" to make sure they don't
conflict with future delimiter names."?

>  put the last item delimited by "/" of the last item delimited by "."\
>      of theFile into theSuffix

 Actually, yes. We'd just have to decide on the scope of such a delimiter.
The only thing that seems feasible is, again, local variable, that is
handler scope.

>It would also be easy to expand to regexp delimiter (in the syntax
>Uli proposed in another mail):
>  define delimiter block as "<" & some text & ">"

 regexp delimiters were Anthony's idea. But we could again allow for
expressions here. But again, I'd prefix this with "expression" to set it
apart from using a chunk expression to define a multi-character delimiter:

 define delimiter block as expression "<" & some text & ">"

>1. Items do not end on a single character, but on several in row:
>      item 2 by "<br>" of "<brown>some</brown><br>text<br>string"
>    returns "text"

 Ruediger, thanks for this example. You're right, we might need
multi-character delimiters. What also comes to mind now that I've seen <BR>
is Windows text, where CRLF is used to separate lines, instead of CR or LF
only on other platforms (OK, MC usually does conversion automatically, but
sometimes you might have binary files with all of those.

>2. Items that end on any of a set of delimiters:
>      item 3 by "." or ";" of "this.is,a;test;string"
>    returns "test"

Couldn't we force the block syntax here? It would be much less ambiguous
(that is, one wouldn't mix it up with boolean expressions) to code:

 define delimiter block as expression "." or expression ","
 block 3 of "this.is,a;test;string"

This way, we wouldn't have this problem anymore?

 Scott, what do you say? Anthony? You think you can add this?

Cheers,
-- M. Uli Kusterer

------------------------------------------------------------
             http://www.weblayout.com/witness
       'The Witnesses of TeachText are everywhere...'

--- HELP SAVE HYPERCARD: ---
Details at: http://www.hyperactivesw.com/SaveHC.html
Sign: http://www.giguere.uqam.ca/petition/hcpetition.html

Reply via email to