using pipe in conditions
Fairlight
fairlite at fairlite.com
Wed Jan 31 05:15:09 PST 2007
This public service announcement was brought to you by Walter Vaughan:
>
> With if: "|a|b|c|" co ("|"{aa{"|")
> what we do is wrap a characters around our testing variable in order to insure
> we match exactly what we are looking for. In this case the aa can only be a an
> "a" or a "b" or a "c". However the pipe has no magical powers. It could have
> been written just as easily as
> if: "#a#b#c#" co ("#"{aa{"#") 'if pipes may appear but not #lbs or
> if: "!a!b!c!" co ("!"{aa{"!") 'if pipes may appear but not !bangs or
> if: "&a&b&c&" co ("&"{aa{"&") 'or want to use an ampersand
>
> or probably at least 30 ways more...
Good grief, that wants join(), split(), and foreach(). The core concept of
lists would be extremely beneficial. Actually, so would completely dynamic
arrays and hashes, and combinations thereof (eg., a hash of arrays).
And on one hand I'll get slammed for not acknowledging fP is fP, and here's
how we do things here in fP Land. But I do acknowledge that.
But then I get slammed for observing the corollary it's far easier to do
some things on the other side of the language fence--and you can -almost-
pick a fence at random from any of the newer languages. Obviously this
stuff would be far harder in C. :)
Unfortunately, the opposing schools of thought to mine want it both ways.
They want me to acknowledge one without acknowledging the other. I think
that's actually been a large problem for years. It's like being asked to
acknowledge light without the existance of dark, or vice versa--it can't be
honestly done.
All I'm saying is, "Hey, Jim over there has a riding lawn mower. Yeah, I
know we have an edger, hedge trimmers, and a weed whacker, but we could
really benefit from a riding lawn mower as well to augment our abilities
and save time and effort. Why rule it out simply because we've never had
one before?"
fP is good at and convenient for many things. This would not be one of
those situations. Doable, but butt-ugly. Could be made better.
mark->
--
Try our new SPF-0 lotion, SunScream[tm]. Get it while it's hot!
More information about the Filepro-list
mailing list