View · Search · Index
No registered users in community xowiki
in last 10 minutes

[Xotcl] Named objects

From: Jonathan Kelly <jonkelly_at_fastmail.fm>
Date: Fri, 10 Aug 2012 11:39:46 +1000

Hi,

I'm trying to get my head into the "named object" space. I was looking
at the container example for a way in and now I'm stuck (again).

nx::Class create SimpleContainer {
  :property {memberClass ::MyItem}
  :property {prefix member}

  # Require the method "autoname" for generating nice names
  :require method autoname

  # The method new is responsible for creating a child of the current
  # container.
  :public method new {args} {
    set item [${:memberClass} create [:]::[:autoname ${:prefix}]
    {*}$args]
  }
}

What does the ":require method autoname" do?

I think I understand what [:autoname ${:prefix}] is/does but what on
earth is "[:]::[:autoname ${:prefix}]" ?

Jon