>And my proposal would be the same. Also, the 'delimiter=' comes out of a
>natural simplification of the 'delimiter is' syntax.
Anthony,
but both "is" and "=" are operators. There's a reason why HC 2.x stopped
supporting:
repeat with x is 1 to 5
Because it'd be mixed up with operators too easily. "=" is used for both
purposes in maths, but "is" isn't.
>I look forward to an example where this does become confusing. However,
>this uses or just like we do in everyday languages. And unless we want to
>do something stupid like forcing everyone to learn mathematical set
>notation, there is not much alternative.
There have been many alternatives already proposed, among others:
put item 1 to 3 with [del[imiter]] "/" ...
put item 1 to 3 [delimited] by "/" ...
are both English, although their abbreviated forms leave a bit to desire,
at least they aren't ambiguous.
>It's there mainly to show extensibility. But it would make some things
>easier. For example, finding sections of HTML documents. Let's say you want
>to check links in HTML:
> put item x (delim=regexp "<a href=(.+?)� .*?>.*?</a>") of HTML...
Please don't. This comes rather natural for a programmer, but you're using
the "item" construct as it wasn't intended to be used. "item" implies a
list. What you are doing is more along the lines of "offset". I don't mind
adding regexps to offset() or creating a similar function that does
regexps, but using English-like filters instead of cryptic regexp filter
strings.
What about:
find expression "<A HREF=" & some text & ">" & some text & "<" & some text
& "</A>"
put word 2 of the foundChunk into startFirstMatch
put word 4 of the foundChunk into endFirstMatch
-- do something with it
This is still not satisfactory, but a lot more readable than regexp "<a
href=(.+?)� .*?>.*?</a>". Another addition to the above could be allowing
an integer, a number, <n> character[s] etc. besides "anything". So, the
formal syntax could be:
find expression <descriptor>
where descriptor would be one of:
<descriptor> & <descriptor>
<descriptor> && <descriptor> (same as <descriptor> & " " &
<descriptor>)
some text -- Wildcard
an integer [between <a> and <b>]
a number [between <a> and <b>]
<n> character[s]
<string>
It's a syntax that can actually be parsed by both computer and human, and
it uses the "&" operator in a logical way. But this still kind of
"overloads" & and &&, so if anyone has a better idea?
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