|
![](/i/fill.gif) |
>>> it's far more verbose and, thus, hurts readability?
>>
>> Far more verbose, and as a consequence it's almost self-explanatory
>> what it does. (Unlike a collection of symbols that have no
>> widely-accepted meaning outside of regex languages...)
>
> symbols like $ or >>=?
FWIW, I think that >>= is a stupid name choice too. Especially for a
function that you almost never need to mention by name anyway...
> yeah, every language has them and you *learn* to live with them. or you
> just endlessly refuse to learn and whine all day long about them...
Look who's whining.
> you are correct though in that the Lisp way of spelling out names is
> more self-explanatory than the Haskell abuse of perlisms.
Almost all of Haskell's operators are just standard mathematical symbols
that everybody already knows. I consider this /more/ readable, not less.
Perl, on the other hand, seems to choose characters at random on a
"which punctuation marks haven't we used yet?" basis. :-P
(There are of course Haskell packages that define rather too many
obscure operators. For example, the arrows package defines operators
such as ***, &&& and >==>. I end up having to look them up every single
time I need to know what they do. I don't consider this to be a good idea.)
>>> then try this in your little language:
>>>
>>> // A phone number with or without hyphens:
>>> [2-9]\d{2}-?\d{3}-?\d{4}
>>>
>>> It looks pretty much like a template for a phone number. I'm sure yours
>>> will look like a little backwards forth script and will be much harder
>>> to figure out.
>>
>> I actually can't figure out what that does, so I can't implement it.
>
> BS.
...or you could have just told me what it does rather than swearing
about it...
>> 1. Commands have cryptic names like "*" or "+".
>
> more than frakkin' $ or >>= ??!
>
> you quite throw away reason completely when you try to invent reasons
> for why you dislike something, don't you?
You've managed to find two operators in the entire Haskell language
which are a bit dubious. Big deal.
>> 2. Literal characters aren't quoted, so it's hard to tell what's
>> literal and what's a command.
>
> there's only .*+?^$\ for commands and the rest are grouping chars ()[]{}
> and literal chars. what's to be confused?
How about "-"? That's not on your list. I'm pretty sure I saw some
examples mentioning ":" as well. How many others are there?
(Of course, it's a trick question. The answer depends on "which of the
20,000 regex variants are we arguing about?")
>> (And 3. since spaces are literal characters, you can't even use
>> spacing to make the structure of the expression clearer.)
>
> you can in perl regex extensions.
So how do you tell the difference between literal whitespace and
whitespace that's just for readability?
Post a reply to this message
|
![](/i/fill.gif) |