Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Looking at the expression

 (isnt it #\;)
I'm assuming "it" is an implicit variable meaning the result of the last expression. I'm also assuming since you have "isnt" you also have "is" and it's used like this:

 (when (and (regex-match "[0-9]" foo) (is it 4))
    (print "it is 4"))
Does boundp exist in Arc, or are unset variables null? I've always thought making them null would make code shorter, though it might cause more problems than it's worth.


is is just CL eq (or rather eql)

Unset variables are not null; that would lead to horrible bugs. But I don't think boundp exists either. So far I haven't needed it.


Since I haven't used a language where unset variables are null or tried to design one, I'll assume you're right. I haven't had to use boundp much in Lisp, but I've had to use its equivalents in other languages quite a bit when working on other people's code for money. I suspect that boundp showing up in code a lot is a sign of badness - most likely in the choice of variable scope. I'm not sure if leaving it out will encourage people to write better code or just write their own workarounds.

Edit: aand binding test results to "it" reminds me of Apple's Hypercard. I will read the entire thread carefully before asking questions next time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: