ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:65559] is there a name for this?
@ 2014-10-09 11:41 Xavier Noria
  2014-10-09 11:59 ` [ruby-core:65560] " Nobuyoshi Nakada
  0 siblings, 1 reply; 7+ messages in thread
From: Xavier Noria @ 2014-10-09 11:41 UTC (permalink / raw
  To: Ruby developers

[-- Attachment #1: Type: text/plain, Size: 263 bytes --]

When describing stuff about constants (working in their guide), you often
need to refer to the first element of the nesting, or Object if the nesting
is empty.

I don't recall this has a user-level name, is there an internal name for it
that the guide could use?

[-- Attachment #2: Type: text/html, Size: 332 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ruby-core:65560] Re: is there a name for this?
  2014-10-09 11:41 [ruby-core:65559] is there a name for this? Xavier Noria
@ 2014-10-09 11:59 ` Nobuyoshi Nakada
  2014-10-09 12:11   ` [ruby-core:65561] " Xavier Noria
  0 siblings, 1 reply; 7+ messages in thread
From: Nobuyoshi Nakada @ 2014-10-09 11:59 UTC (permalink / raw
  To: Ruby developers

On 2014/10/09 20:41, Xavier Noria wrote:
> When describing stuff about constants (working in their guide), you often need to refer to the first element of the nesting, or Object if the nesting is empty.
> 
> I don't recall this has a user-level name, is there an internal name for it that the guide could use?

Maybe "cref", as an implementation detail name?

-- 
Nobu Nakada

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ruby-core:65561] Re: is there a name for this?
  2014-10-09 11:59 ` [ruby-core:65560] " Nobuyoshi Nakada
@ 2014-10-09 12:11   ` Xavier Noria
  2014-10-09 13:14     ` [ruby-core:65562] " Yukihiro Matsumoto
  0 siblings, 1 reply; 7+ messages in thread
From: Xavier Noria @ 2014-10-09 12:11 UTC (permalink / raw
  To: Ruby developers

[-- Attachment #1: Type: text/plain, Size: 592 bytes --]

On Thu, Oct 9, 2014 at 1:59 PM, Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:

On 2014/10/09 20:41, Xavier Noria wrote:
> > When describing stuff about constants (working in their guide), you
> often need to refer to the first element of the nesting, or Object if the
> nesting is empty.
> >
> > I don't recall this has a user-level name, is there an internal name for
> it that the guide could use?
>
> Maybe "cref", as an implementation detail name?
>

Awesome, if it was fine to promote "cref" to a user-level name the guide
could define it and use it where necessary. That would be handy.

[-- Attachment #2: Type: text/html, Size: 1030 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ruby-core:65562] Re: is there a name for this?
  2014-10-09 12:11   ` [ruby-core:65561] " Xavier Noria
@ 2014-10-09 13:14     ` Yukihiro Matsumoto
  2014-10-09 13:26       ` [ruby-core:65563] " Xavier Noria
  0 siblings, 1 reply; 7+ messages in thread
From: Yukihiro Matsumoto @ 2014-10-09 13:14 UTC (permalink / raw
  To: ruby-core

Hi,

In message "Re: [ruby-core:65561] Re: is there a name for this?"
    on Thu, 9 Oct 2014 14:11:54 +0200, Xavier Noria <fxn@hashref.com> writes:

|On Thu, Oct 9, 2014 at 1:59 PM, Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
|
|On 2014/10/09 20:41, Xavier Noria wrote:
|> > When describing stuff about constants (working in their guide), you
|> often need to refer to the first element of the nesting, or Object if the
|> nesting is empty.
|> >
|> > I don't recall this has a user-level name, is there an internal name for
|> it that the guide could use?
|>
|> Maybe "cref", as an implementation detail name?
|>
|
|Awesome, if it was fine to promote "cref" to a user-level name the guide
|could define it and use it where necessary. That would be handy.

"cref" stands for class reference.  It's a placeholder for the
reference to the surrounding class.  We need a placeholder because the
class itself is not created yet at the compile time.

							matz.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ruby-core:65563] Re: is there a name for this?
  2014-10-09 13:14     ` [ruby-core:65562] " Yukihiro Matsumoto
@ 2014-10-09 13:26       ` Xavier Noria
  2014-10-09 16:57         ` [ruby-core:65567] " Yukihiro Matsumoto
  0 siblings, 1 reply; 7+ messages in thread
From: Xavier Noria @ 2014-10-09 13:26 UTC (permalink / raw
  To: Ruby developers

[-- Attachment #1: Type: text/plain, Size: 370 bytes --]

Thanks Matz.

Let me put a concrete example to evaluate:

"A constant appearing after a +class+ or +module+ keyword

  module DRb
    class DRbMessage
    end
  end

is checked in the cref and only in the cref."

Sounds good? Prefer another term?

Xavier

PS: "checked" has a special meaning at that point, defined ad-hoc for
convenience, it implies the autoload logic.

[-- Attachment #2: Type: text/html, Size: 1144 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ruby-core:65567] Re: is there a name for this?
  2014-10-09 13:26       ` [ruby-core:65563] " Xavier Noria
@ 2014-10-09 16:57         ` Yukihiro Matsumoto
  2014-10-09 22:15           ` [ruby-core:65572] " Xavier Noria
  0 siblings, 1 reply; 7+ messages in thread
From: Yukihiro Matsumoto @ 2014-10-09 16:57 UTC (permalink / raw
  To: ruby-core

Hi,

In message "Re: [ruby-core:65563] Re: is there a name for this?"
    on Thu, 9 Oct 2014 15:26:45 +0200, Xavier Noria <fxn@hashref.com> writes:

|Thanks Matz.
|
|Let me put a concrete example to evaluate:
|
|"A constant appearing after a +class+ or +module+ keyword
|
|  module DRb
|    class DRbMessage
|    end
|  end
|
|is checked in the cref and only in the cref."
|
|Sounds good? Prefer another term?
|
|Xavier
|
|PS: "checked" has a special meaning at that point, defined ad-hoc for
|convenience, it implies the autoload logic.

That's correct for CRuby implementation. Other implementation may use
different technique and terms, for example, mruby uses the term
target_class.  I often use "surrounding class/module" to explain the
behavior.

							matz.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ruby-core:65572] Re: is there a name for this?
  2014-10-09 16:57         ` [ruby-core:65567] " Yukihiro Matsumoto
@ 2014-10-09 22:15           ` Xavier Noria
  0 siblings, 0 replies; 7+ messages in thread
From: Xavier Noria @ 2014-10-09 22:15 UTC (permalink / raw
  To: Ruby developers

[-- Attachment #1: Type: text/plain, Size: 1284 bytes --]

On Thu, Oct 9, 2014 at 6:57 PM, Yukihiro Matsumoto <matz@ruby.or.jp> wrote:

>
> That's correct for CRuby implementation. Other implementation may use
> different technique and terms, for example, mruby uses the term
> target_class.  I often use "surrounding class/module" to explain the
> behavior.
>
>                                                         matz.
>

Oh yes.

The guide documents constants conceptually with nothing (to my knowledge)
depending on the interpreter.

Albeit the chosen name could be inspired by CRuby's internal terminology,
it would be presented to the reader as a formal definition. Let's imagine
that there's a section explaining nesting and at the end of it the guide
says:

     We define "cref" to be the first element of the nesting,
     or Object if the nesting is empty.

That would be just vocabulary, a name we introduce for convenience. Such
term would allow the guide to just say, for instance:

    A constant appearing after a +class+ or +module+ keyword
    is checked in the cref and only in the cref.

That's the goal, to be able to express that and other things in such a
brief way.

We could define that concept as "cref", or "target class/module", or
"surrounding class/module"... It is really up to us, whatever you guys
prefer.

[-- Attachment #2: Type: text/html, Size: 3346 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-10-09 22:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-09 11:41 [ruby-core:65559] is there a name for this? Xavier Noria
2014-10-09 11:59 ` [ruby-core:65560] " Nobuyoshi Nakada
2014-10-09 12:11   ` [ruby-core:65561] " Xavier Noria
2014-10-09 13:14     ` [ruby-core:65562] " Yukihiro Matsumoto
2014-10-09 13:26       ` [ruby-core:65563] " Xavier Noria
2014-10-09 16:57         ` [ruby-core:65567] " Yukihiro Matsumoto
2014-10-09 22:15           ` [ruby-core:65572] " Xavier Noria

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).