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

  • Home
  • SEARCH
  • 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 534405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:36:32+00:00 2026-05-13T09:36:32+00:00

Someone said you can have (implementation inheritance) with Rebol using get. So I tried:

  • 0

Someone said you can have (implementation inheritance) with Rebol using get. So I tried:

shape: context [
  x: 0
  y: 0
  draw: func['object][
    probe get object
  ]
]

circle: make shape [
  radius: 10
  draw: get in shape 'draw
]

rectangle: make shape [
  draw: get in shape 'draw
]

I want to pass the object by reference not by value so I pass only the name using ‘Object. But then I have to call it like this

circle/draw 'circle

which is rather lame as I need to repeat the name circle twice while in usual inheritance there is the this keyword which avoid this kind of unatural syntax. Is there a more elegant way ?

Thanks.

  • 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-13T09:36:32+00:00Added an answer on May 13, 2026 at 9:36 am

    There is a self word. At the risk of creating a false sense of certainty about that, I’ll give you an example that presumably does what you want:

    shape: make object! [
        x: 0
        y: 0
        draw: func [object [object!]] [
            probe object
        ]
    ]
    
    circle: make shape [
        radius: 10
        draw: func [] [
            shape/draw self
        ]
    ] 
    
    rectangle: make shape [
        draw: func [] [
            shape/draw self
        ]
    ]
    

    Here we’ve made functions that take zero arguments by calling the base class function with the appropriate “self”

    Beware: like other words, it gets bound…and the binding sticks. This can get tricky once you start working with abstractions…

    selfWordAlias: func [] [
        return 'self
    ]
    
    triangle: make shape [
        draw: func [] [
            shape/draw get selfWordAlias
        ]
    ]
    

    Calling triangle/draw will probably surprise you. You’re in the object method and selfWordAlias returns the word “self”. But the notion of self was captured and bound at the time the selfWordAlias was defined, which was in the global system context. So that’s what you get back.

    There are tools for dealing with this, but make sure you’ve got a firm grip on Scoping in Rebol !

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

Sidebar

Ask A Question

Stats

  • Questions 258k
  • Answers 258k
  • 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 What about: string input ="ece4241692a1c7434da51fc1399ea2fa155d4fc983084ea59d1455afc79fafed"; string target = "<" +… May 13, 2026 at 11:04 am
  • Editorial Team
    Editorial Team added an answer There are a few strategies that work fairly well. You… May 13, 2026 at 11:04 am
  • Editorial Team
    Editorial Team added an answer That's old school, Oracle specific LEFT JOIN syntax. You want… May 13, 2026 at 11:04 am

Related Questions

How do you generally resolve a programming problem, for example, when you have to
We have some software which relied on certain behavior from another ( very commonly
FYI I'm programming in objective-C but anyone might be able to help. I've been
I am learning to be a dba, and the one thing i am missing
I work in a medium sized team and I run into these painfully large

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.