(2013/08/20 8:57), charliesome (Charlie Somerville) wrote:
> ko1 - please see attached a slide for the upcoming developer meeting in Japan.

My position is negative to introduce new %f() syntax.

I like suffix that mame proposed [ruby-core:55705].

There are two dimmention:
(1) frozen.
(2) once.

mame-san proposed (2) feature. And `once' feature doesn't return frozen,
but return same object.

Try with once suffix with regexp.

##
3.times{|i|
  r = /foo/o
  p [r.object_id, r.frozen?]
  r.instance_variable_set(:@foo, i)
  p r.instance_variable_get(:@foo)
}
#=>
[23212812, false]
0
[23212812, false]
1
[23212812, false]
2
##

I believe you (charliesome) *don't* care about syntax, but you want a
feature to introduce frozen, or same string literal. right?


My idea is to introduce frozen suffix for (1) and once suffix for (2).

  frozen_str = "foo"f
  once_str = "foo"o
  3.times{|i|
    once_dynamic_str = "#{i}"o #=> every time it returns "0".
  }
  frozen_and_once_str = "foo"of

I think %f() is not good syntax.
... "f" and "o" suffix are also bad? :P

-- 
// SASADA Koichi at atdot dot net