question about types
I've been fiddling with the ModalBar and TubeBell STK functions, and I wrote a subroutine that took a TubeBell. as a parameter: fun int presets( TubeBell bell ) { ... } but accidentally called it with a param that was a ModalBar. This did not gen a type error and I got silence until I added a param that doesn't exist in a TubeBell. Then ChucK complained that it couldn't find TubeBell strikePosition. Howcum? (i.e., why no typing complaint? It took me an hour to find out why I was getting silence...) -- Gary ---- Chess: http://chessnut.net/ Homepage: http://garywilliams.org/ Blog: http://tfs_reluctant.blogspot.com/ ChucK Blog: http://b-chuck.blogspot.com/ Resume: http://garywilliams.org/resume.htm Store: http://www.cafeshops.com/tfsreluctant/ Phone: (607) 775-0408 Permanent email: gwms@corninglink.com
Hi Gary!
I've been fiddling with the ModalBar and TubeBell STK functions, and I wrote a subroutine that took a TubeBell. as a parameter:
fun int presets( TubeBell bell ) { ... }
but accidentally called it with a param that was a ModalBar. This did not gen a type error and I got silence until I added a param that doesn't exist in a TubeBell. Then ChucK complained that it couldn't find TubeBell strikePosition.
This is a bug with 1.1.x.x - ugen types are mishandled across function calls. It will most certainly be fixed.
(i.e., why no typing complaint? It took me an hour to find out why I was getting silence...)
Sorry about this. It is precisely this type of uncertainty that ChucK is trying to eliminate, but that hinges on the type checker being correct. We will do our best to make things more robust in 1.2. Best, Ge!
participants (2)
-
Gary Williams
-
Ge Wang