Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 570263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:22:58+00:00 2026-05-13T13:22:58+00:00

I dived into understanding the Ruby object model in the last weeks, and although

  • 0

I dived into understanding the Ruby object model in the last weeks, and although so far was only a user of the fruits of ruby’s and python’s object in the past, I became curious how these things might differ in other languages.

Years ago I touched smalltalk’s squeak. Smalltalk is often figuring as a referential object oriented language, that’s why I am interested in it. The ruby object model does not make distinction between objects and classes, the existence singleton object makes every object a prototype extendible when necessary. As I know all these things where defined as the meta-object protocol. These things make life easier than what other less-or-non-dynamic languages like C++ or Java enable.

Please could you give me an idea, how dynamic languages, particularly smalltalk, python and ruby differ in the realisation of the meta-object protocol?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:22:59+00:00Added an answer on May 13, 2026 at 1:22 pm

    In Python, each object has one namespace — the object’s “attributes”, accessible in that namespace, can be methods, simple references to other objects (callable or not), or be synthesized on the fly by descriptors (plain attributes may live in the instance or in the class, but descriptors — including functions as descriptors that synthesize methods — are only used if they live in the class, not the instance; so in particular “special methods” are only special if defined in the class, not the instance). Attribute-handling builtins and special methods (getattr, setattr, __getattr__, __setattr__, …) work just the same way across the single namespace of the object, whether referring to “plain attributes” or not.

    The key point is that for any object a, in Python, a.b may be a method (or other callable) or not: the Python compiler doesn’t know (nor care), you can take the reference a.b and (e.g.) pass it as an argument, return it as a result, append it to a list, and so forth, none of these operations implies calling a.b. If and when you want to (try and) call a.b, you do it explicitly by postfixing parentheses: a.b() if you want to call it without arguments.

    In Ruby, methods and attributes of an object live in separate namespaces (so you can have an object with a method and an attribute with the same name, which in Python you can’t) and “just mentioning” an argument-less method implicitly calls it (so c=a.b might be just taking an attribute reference, or it might be calling a.b(); if b names both a method and an attribute in a, I don’t recall what heuristic rule is used to disambiguate the use). So if you want to just take method references (e.g to stash in some container or use as arguments or return values), and later perform the call, you use different syntax.

    Smalltalk also has separate namespaces, like Ruby, but then you can’t refer to a given object’s “non-method” attributes (each object only “sees” its own attributes), so this ambiguity does not arise (but you still do have to use specific messages to extract, and later call, a “method reference”).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 382k
  • Answers 382k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can use _tstring to represent and std::string with a… May 14, 2026 at 10:32 pm
  • Editorial Team
    Editorial Team added an answer You are correct in that glibc uses symbol versioning. If… May 14, 2026 at 10:32 pm
  • Editorial Team
    Editorial Team added an answer You will probably need to adjust the top and left… May 14, 2026 at 10:32 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.