[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Scheme acceptance [no flames]



> 
> More constructively than Greg (-:, let me suggest that you fix a
> semantics first, and figure out a syntax second.  Is the intended
> semantics for == binding or assignment?
> 

The semantics are already defined in Perl.  The "=~" operator
binds a pattern match to a string.  Depending on the form of the
pattern match, modification of the string may take place:

$foo =~ s/"a"/"b"/;

Would replace 'a' with 'b' in $foo, while:

$foo =~ /"a"/;

Would return "true" if $foo contains the character 'a' at least once.

Now, you might argue that we should have separate operators for
separate meanings, and of course you are right.  I'm just pointing
out the way Perl handles these meanings, and that this seems to
be popular with those types... :-)

It's basically an extension of the way sed, awk, grep, etc., all work,
so it's very familiar to UNIX-types.  It's not mathematical, it's
not elegant, and it's not pretty.  But it *is* familiar.

A side note -- Matthias has written to me off-list regarding MzScheme's
existing regexp handling, which seems to provide most of the features
one would ever need.

-Brent