param(string :: &str){ string_append_lit("["); string_append_U64(x); string_append_lit("]"); } Thoughts?
-
-
-
Replying to @AbnerCoimbre
param(list :: &node_list) param(arena :: arena){ push_node(alloc_new_node("Hello")); push_node(alloc_new_node("World!")); } See?
2 replies 0 retweets 0 likes -
Replying to @AllenWebster4th @AbnerCoimbre
does this mean you're declaring that, in the context of curly-braced region, the variables 'list' and 'arena' are implicitly used as call arguments (in calls to procedures that take values of type &node_list and arena), like the implicit 'this' in the body of a C++ member func?
1 reply 0 retweets 1 like -
this could potentially make uses of certain C APIs much more terse than they usually are!
1 reply 0 retweets 1 like -
Replying to @JamesWidman @AbnerCoimbre
ding ding ding! It seems really handy when you're doing lots of operations in a row on a particular "object".
2 replies 0 retweets 1 like -
You can already do a shitty version of this feature in C++ by having operators on a struct return a reference to the struct. This leads to: string Foo; Foo. Append("["). Append(X). Append("]");
1 reply 0 retweets 4 likes -
Except now the burden is on the implementer to plan for this instead of the caller, which is a pretty important difference!
2 replies 0 retweets 0 likes
Yes, that is why I said "shitty version". Like all things in C++, it doesn't actually work the way a thoughtful programmer would want, but sometimes it does something slightly useful for certain circumstances. In this case, the after-the-fact implementer has to make wrappers :(
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.