logo       

Re: bug report: Exception.debug = true: msg#00264

audio.supercollider.devel

Subject: Re: bug report: Exception.debug = true

On Tuesday, Aug 31, 2004, at 15:33 US/Eastern, James McCartney wrote:

e = (f: #{ "throwing error".postln; 1.blorg }).know_(true);
f = Environment.make({ ~f = #{ ~event.f } }).put(\event, e).know_(true);

You know why this code does not work, right?
When calling a function in a dictionary as if it were a method, the current environment is not changed to the dictionary. This is so you can have functions that refer to the current environment. If the current environment were changed you could not access the one in place where the function was called.

Yeah, I "know" that but I usually forget because I don't typically use environments directly. Most of the time I'm using my class, AdhocClass, which does automatically push the environment.

This will actually go into the function in the event, and is more like my real code:

e = (f: #{ "throwing error".postln; 1.blorg }).know_(true);
f = AdhocClass({ ~f = #{ ~event.f } }).put(\event, e);
f.f

hjh
____________________________________

H. James Harkins /// dewdrop_world
http://www.dewdrop-world.net

"If attacked by a lion, thrust your arm down his throat.
This takes some practice." -- Cyril Connolly

_______________________________________________
sc-dev mailing list
sc-dev-Ayv8T2snMLBt9CRQqspbbg@xxxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-dev
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise