[PD-dev] pd-extended loadlib request

Mathieu Bouchard matju at artengine.ca
Thu Jan 24 21:14:21 CET 2008


On Thu, 24 Jan 2008, Frank Barknecht wrote:

> overloading like the other languages, so aliases are the workaround we
> use. But the use is similar: Operator overloading includes adding
> an additional name and syntax for a function/method:
> A = Matrix.new(m,n)
> B = Matrix.new(n,m)
> C = Matrix.multipy(A,B)
> now with an overloaded operator* you can also say: C = A*B.

You absolutely don't need to have an original name like "multiply" that 
you alias to "operator*". You can define "operator*" on its own and that's 
all. It's not like you need any operator to be the shortcut of something 
already existing.

(JAVA might be different because libraries were first designed without 
operator support, which was then added later. in that case, "shortcut 
for..." makes sense)

> True operator overloading of course would mean, that you could user the 
> regular "+" object for matrices in Pd as well.

You can't even do that in C++. If you have a class that makes additions, 
you can't modify that to support other kinds of additions without touching 
the source file. You can't do that in Python either. You _can_ do it in 
Ruby.

You may ask yourself what is the proper kind of analogy to do in this 
context: is a [+] class in pd similar to an Addition class in C++, or is 
it similar to a + method in a class of numbers? Depends. Pd does some 
things inside out, so it complicates some comparisons.

> To each his own, especially with style questions, but I don't know
> anybody else besides Hans who prefers the long version of triggers.

Whether it's one or the other, you still have to look up the help file to 
know what it does. "trigger anything anything" doesn't tell you at all 
what's going on. Before already knowing Pd, "trigger" sounds like that 
would be a good name for [bang] and [bng] and such. I'd rather call it a 
"tee" than a "trigger".

compare with
   http://plumbing.hardwarestore.com/52-298-abs-fittings/abs-sanitary-tee-456269.aspx

also compare with http://en.wikipedia.org/wiki/Tee_(Unix) but this tee 
can't pipe to two processes at once, so it's not so similar.

  _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada


More information about the Pd-dev mailing list