# Defined? bug

**URL:** <https://www.ruby-forum.com/t/defined-bug/129544>\
**Category:** IronRuby\
**Created:** [February 19, 2008, 1:38pm UTC](https://www.ruby-forum.com/t/defined-bug/129544 "2008-02-19T13:38:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wayne\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b5ac83/32.png) [@Wayne\_K](https://www.ruby-forum.com/u/Wayne_K)\
**Post date:** [February 19, 2008, 1:38pm UTC](https://www.ruby-forum.com/t/defined-bug/129544/1 "2008-02-19T13:38:55Z")

</div>

I assume this is just one of the many features that is yet to be fully  
implemented, but there was no TODO comment in the code, so I thought  
I’d mention that the current implementation of the defined? function in  
AstNodeDescriptionExpression.TransformRead is overly simplistic.

For example, it always returns “constant” for the expression:

defined? Foo

where as it should return nil if constant Foo hasn’t been initialized.  
In general, each type of expression has it’s own semantics as to when it  
is considered defined.

Cheers, Wayne.

---

<div class="post-metadata">

**Author:** ![Wayne\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b5ac83/32.png) [@Wayne\_K](https://www.ruby-forum.com/u/Wayne_K)\
**Post date:** [February 19, 2008, 6:27pm UTC](https://www.ruby-forum.com/t/defined-bug/129544/2 "2008-02-19T18:27:47Z")

</div>

Yes, your assumption is right 🙂 We have a test that says todo.

Tomas
