nobu / ruby-lang.org wrote:
> I don't like "mini-language" which needs a parser.

OK, what about an API similar to pthread_attr_set*?

Hash#[]=

	rb_method_attr_set_required(&attr, 0);
	rb_method_attr_set_const(&attr, 0);
	rb_method_attr_set_persist(&attr, 0);
	rb_method_attr_set_required(&attr, 1);
	rb_def_method(rb_Hash, rb_hash_aset, &attr);

Maybe the above is too verbose:

	rb_method_attr_setfl(&attr, 0, RB_CONST|RB_PERSIST|RB_REQUIRED);
	rb_method_attr_setfl(&attr, 1, RB_REQUIRED);
	rb_def_method(rb_Hash, "[]=", rb_hash_aset, &attr);


For "exception: (true|false)"

	rb_method_attr_setkw_const(&attr, "exception", Qtrue);



Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>