On 11/22/2014 12:07 PM, Tom Rondeau wrote:
On Sat, Nov 22, 2014 at 11:08 AM, Mike Willis <[email protected] <mailto:[email protected]>> wrote:

    Thanks to Sebastian for his help.

    This appears to be a bug? Well maybe my bug. My input parameter was 
intended as an identification number and not unreasonably I called it “id”. 
Apparently I can’t call the parameter “id”. I can call it “ix” and grc will 
find it. What on earth?

    Mike


$ ipython

In [1]: help(id)

Help on built-in function id in module __builtin__:

id(...)
    id(object) -> integer
Return the identity of an object. This is guaranteed to be unique among simultaneously existing objects. (Hint: it's the object's memory address.)



GRC runs in Python. It outputs Python code. You tried to use a reserved Python keyword.

Tom

It is *theoretically* possible for GRC to identify "stuff" that will later cause you problems at runtime due to Pythonisms. But that would *vastly* increase GRC's complexity, and it would be error-prone, and "false positive" rather a lot, it's simply not practical. GRC could also have its own "language" for evaluating expressions, rather than use Python. That would come with its own set of surprises and gotchas, so, better to use a language that is already well-developed, well-understood, and with well-defined semantics.

There's no real way to get around the fact that, at the end of the day, you're programming, and thus run into all the same "gotchas" that
  "conventional" (is there such a thing any more) programmers run into.




--
Marcus Leech
Principal Investigator
Shirleys Bay Radio Astronomy Consortium
http://www.sbrac.org

_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to