3 ms·
> So while you are right, it is basically sugar for days(2).from_now(), but you couldn't call the function that way. It must be attached to an instance of an u
by pcwalton 13y ago
> So while you are right, it is basically sugar for days(2).from_now(), but you couldn't call the function that way. It must be attached to an instance of an uint.
We plan to implement that, it's just not implemented yet: http://www.reddit.com/r/rust/comments/14pucx/rfc_method_call_syntax_as_sugar/ http://www.reddit.com/r/rust/comments/14pucx/rfc_method_call...
> Whereas with the clojure version they are just normal functions, but the threading macro gives you that English readability you are looking for.
You could do that with a macro in Rust as well. We don't make ordinary functions acquire that sugar for namespacing reasons: you can have multiple methods called e.g. "get" in scope as long as they're attached to different types, but that isn't true for functions.