Monday, March 14, 2011

How not to define a symbol in Magik

Found in some custom code...

tbl_name << "tx_query".as_symbol()

... should really be...

tbl_name << :tx_query

If you are calling :as_symbol() on a string, that should be a red flag to you that you are doing something wrong. You should really only call :as_symbol() on a variable.

No comments: