Re: Re: This is kind of cool

"Mark Hahn" <[email protected]>
Newsgroups gmane.comp.lang.prothon.user
Message-ID <005001c459a9$7d654370$0d01a8c0@MarkVaio>
Paul Prescod wrote:

> The basic idea is that you can define binary infix operators that
> start and end with tildes. The tilde-bracketing makes it easy to
> parse. The stuff between the tildes can be almost anything other than
> whitespace.
>
> I suppose operator precedence is where it starts to get a little
> complicated. It isn't my highest priority so I'm not going to spend
> cycles trying to figure it out...and I'm not sure whether you are
> interested in such a feature.

If we wanted user-defined operators I'd argue for Ruby's solution. They let
you define symbols the same as labels.  They make an exception allowing
arbitrary symbols only after the "def" in that one place.

    def +(a, b):
        blah blah blah

    def ~%~(x, y):
        blah blah blah
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.