Title: Get receiver object for different levels of calling stack · mruby/mruby · Discussion #6072 · GitHub
Open Graph Title: Get receiver object for different levels of calling stack · mruby/mruby · Discussion #6072
X Title: Get receiver object for different levels of calling stack · mruby/mruby · Discussion #6072
Description: Get receiver object for different levels of calling stack
Open Graph Description: In cruby there is the gem binding_of_caller which can provide the calling object for different levels of the calling stack e.g. binding.of_caller(2).eval("self") Can I get this info also for mruby ?
X Description: In cruby there is the gem binding_of_caller which can provide the calling object for different levels of the calling stack e.g. binding.of_caller(2).eval("self") Can I get this info also ...
Opengraph URL: https://github.com/mruby/mruby/discussions/6072
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Get receiver object for different levels of calling stack","text":"In cruby there is the gem binding_of_caller which can provide the calling object for different levels of the calling stack
\ne.g.
\nbinding.of_caller(2).eval(\"self\")
\nCan I get this info also for mruby ?
","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"I can think of two things.
\n\n- If you are using the mrbc command, the required
-g switch is not specified. \n- The
mrb_proc_get_caller() and mrb_binding_new() used by mrb_binding_of_caller() do not support any level of caller.
\nThey must be extended to accept ci arguments. \n
\nAnd, there was a mistake in #6072 (comment).
\nSince the current ci needs to be removed, the range is 0 <= caller_level < (mrb->c->ci - mrb->c->cibase) and is obtained as mrb->c->ci[-1 - caller_level].
","upvoteCount":0,"url":"https://github.com/mruby/mruby/discussions/6072#discussioncomment-7209447"}}}
| route-pattern | /:user_id/:repository/discussions/:number(.:format) |
| route-controller | discussions |
| route-action | show |
| fetch-nonce | v2:89ad0fc9-5db4-e8e4-574a-bd9d4d2ae9a6 |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | 9492:154085:92A1E30:C29DA92:696E08D0 |
| html-safe-nonce | a190e467414ed15d0a5862cedf948c1896dc1e009617edab8b624b1176de2885 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NDkyOjE1NDA4NTo5MkExRTMwOkMyOURBOTI6Njk2RTA4RDAiLCJ2aXNpdG9yX2lkIjoiOTA0NTAyODQzOTM5NDc0ODYyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8d81e4d559706f8ffabde481bcef6117c0c990435080b1890792349c5302bb4d |
| hovercard-subject-tag | discussion:5699933 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/mruby/mruby/discussions/6072 |
| twitter:image | https://opengraph.githubassets.com/85f5669f27509c7309648c52d46503cb5722e312dc5903ad42f836dfeaf77fda/mruby/mruby/discussions/6072 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/85f5669f27509c7309648c52d46503cb5722e312dc5903ad42f836dfeaf77fda/mruby/mruby/discussions/6072 |
| og:image:alt | In cruby there is the gem binding_of_caller which can provide the calling object for different levels of the calling stack e.g. binding.of_caller(2).eval("self") Can I get this info also for mruby ? |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9b5131b207ddd175abf059a848d5f4302ec0606b02211b989013be49cf08593e |
| turbo-cache-control | no-preview |
| go-import | github.com/mruby/mruby git https://github.com/mruby/mruby.git |
| octolytics-dimension-user_id | 1796512 |
| octolytics-dimension-user_login | mruby |
| octolytics-dimension-repository_id | 4073516 |
| octolytics-dimension-repository_nwo | mruby/mruby |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 4073516 |
| octolytics-dimension-repository_network_root_nwo | mruby/mruby |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f8590a63bfc8093b241930ca57d536c9a50f9680 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width