On Dec 18, 2006, at 12:42 PM, Mathieu Bouchard wrote:
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.
C/C++ is not very strict. It allows you to just change what you call a chunk of memory without complaint. Try Pascal, that is strict. Or Pd's floats and symbols. There is no way to make a float into symbol or vice versa without trickery. For example, these doesn't work:
[123( [symbol 123( [symbol 123( | | | [symbol] [ \ <-- (symbol box) [float]
.hc
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
------------------------------------------------------------------------
Terrorism is not an enemy. It cannot be defeated. It's a tactic. It's about as sensible to say we declare war on night attacks and expect we're going to win that war. We're not going to win the war on terrorism. - retired U.S. Army general, William Odom