Re: [Audacity-nyquist] using *scratch* as an association list variable
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Roger D. <rb...@cs...> - 2009-11-30 00:28:46
|
I made a mistake earlier when I said property lists do not work with *scratch* -- I must have made a typo when I made a quick test, but it seems to work as expected. I think this was Edgar's final conclusion: that the best way to pass data from one plug-in to another is to set the data as a property on the symbol *scratch*. This is certainly my opinion. There was some talk of association lists, efficiency, etc. One thing to keep in mind is that Nyquist (along with virtually all interpreted languages without JIT compilers) runs about 100 times slower than C code, so you can search a property list or association list of length >100 faster than you can compute a hash function. At some point, fast data structures become better than linear search, but any time you can use a built-in primitive function, you are likely to come out ahead. Plus, the code is much easier to read and trust if it uses built-in structures and algorithms. -Roger |