Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.ruby > #3653
| From | Brian Candler <b.candler@pobox.com> |
|---|---|
| Newsgroups | comp.lang.ruby |
| Subject | Re: Is everything object ? |
| Date | 2011-04-28 15:22 -0500 |
| Organization | Service de news de lacave.net |
| Message-ID | <2b40a6944b6aa778473e391ab4115eb9@ruby-forum.com> (permalink) |
| References | <62f261dc2ccebf22a5a04124a9b3bc7f@ruby-forum.com> <BANLkTimZhrtN8Y2c_auueOHsUwakAfgg=w@mail.gmail.com> |
Josh Cheek wrote in post #995509: > There are only three _relevant_ things that I can think of right now > that > aren't objects. Let us say that a thing is relevant as a nonobject if it > means you can't manipulate it like an object (ie pass it as an argument, > store it in a variable, and call methods on it). The first is boolean > methods like "&&" and "||", the second is keywords like "class", and > "def", > the third is variables, which point to objects but are not objects > themselves, thus cannot be pointed to by other variables. I think it's reasonable to say that most operators in Ruby are in fact syntactic sugar for method calls; so are some other syntactic constructions like a[b] and a[b] = c. All these can be invoked equivalently using send, e.g. a.send(:[]=, b, c) However the assignment operators =, +=, -= etc are *not* mapped to method calls, in addition to the short-circuit boolean operators as you've already pointed out. It's perhaps also worth mentioning that literals don't invoke method calls; e.g. "foo" and /foo/ can't be intercepted by redefining String.new or Regexp.new -- Posted via http://www.ruby-forum.com/.
Back to comp.lang.ruby | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Is everything object ? "amir e." <aef1370@gmail.com> - 2011-04-28 04:48 -0500
Re: Is everything object ? Urabe Shyouhei <shyouhei@ruby-lang.org> - 2011-04-28 04:56 -0500
Re: Is everything object ? Robert Klemme <shortcutter@googlemail.com> - 2011-04-28 04:59 -0500
Re: Is everything object ? Roger Braun <roger@rogerbraun.net> - 2011-04-28 04:54 -0500
Re: Is everything object ? Josh Cheek <josh.cheek@gmail.com> - 2011-04-28 06:52 -0500
Re: Is everything object ? Roger Braun <roger@rogerbraun.net> - 2011-04-28 10:26 -0500
Re: Is everything object ? Michael Sokol <mikaa123@gmail.com> - 2011-04-28 10:49 -0500
Re: Is everything object ? Josh Cheek <josh.cheek@gmail.com> - 2011-04-28 12:23 -0500
Re: Is everything object ? Josh Cheek <josh.cheek@gmail.com> - 2011-04-28 18:39 -0500
Re: Is everything object ? Josh Cheek <josh.cheek@gmail.com> - 2011-04-28 23:09 -0500
Re: Is everything object ? Josh Cheek <josh.cheek@gmail.com> - 2011-04-29 18:01 -0500
Re: Is everything object ? Brian Candler <b.candler@pobox.com> - 2011-04-28 15:22 -0500
Re: Is everything object ? Phillip Gawlowski <cmdjackryan@googlemail.com> - 2011-04-28 15:36 -0500
Re: Is everything object ? 7stud -- <bbxx789_05ss@yahoo.com> - 2011-04-28 11:54 -0500
Re: Is everything object ? 7stud -- <bbxx789_05ss@yahoo.com> - 2011-04-28 18:50 -0500
Re: Is everything object ? Stu <stu@rubyprogrammer.net> - 2011-04-28 14:43 -0500
Re: Is everything object ? Justin Collins <justincollins@ucla.edu> - 2011-04-28 23:37 -0500
csiph-web