[PD-dev] strings

Mathieu Bouchard matju at artengine.ca
Mon Dec 18 18:42:56 CET 2006


On Mon, 18 Dec 2006, Hans-Christoph Steiner wrote:
> On Dec 17, 2006, at 1:36 AM, Mathieu Bouchard wrote:
>> That's aiming low. Why shouldn't there be any automatic casts between the 
>> two?
>
> Automatic type conversion sounds like a really bad idea if the language only 
> partially supports it.

If that's the case then pd is a really bad idea.

It's not possible to typecast any value of a type to any value of another 
type, all of the time. That's even true in the most typecast-frenzy 
languages ever.

There's no such requirement that implicit casts have to be impossibly well 
supported in order to be a good idea. You're just dismissing all forms of 
implicit casts as being bad ideas.

> Pd is strongly typed, so what Martin says is definitely appropriate.

Non-sequitur, there are languages that have quite strict and elaborate 
type checking and yet which support implicit casts. For example, C++.

And then, in many cases, languages can become less strictly checked 
without any problems, as long as nothing actually relies on type 
violations. Because pd doesn't have any error handling (in the sense of pd 
patches being able to figure out their own problems), if any patch doesn't 
spit out any error messages, it would run the same if there were more 
implicit casts made, because the patches would never trigger those 
implicit casts anyway.

> Perl is the opposite, everything can be automatically cast, so there it 
> makes sense.

No, in Perl there's no way that you can cast something to a pointer. You 
can use the backslash operator to make a pointer to anything, but 
that's not a cast-to-pointer, because if you use it on a pointer, you 
don't get the same pointer, you get a new pointer.

> So... anyone want to code up some of these ideas?  We could try them out 
> in the next Pd-extended.

Martin's solution, my solution, or your solution?

  _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju
| Freelance Digital Arts Engineer, Montréal QC Canada


More information about the Pd-dev mailing list