Skip to content

RFC: Remove bind #2189

@nikomatsakis

Description

@nikomatsakis

I think it's time for bind to go. My reasons:

  • The language will have that many fewer keywords and syntactic constructs.
  • The semantics are incompatible with closures. Right now, if I write foo(_, f()) this evaluates f() right away and binds the result into the closure. This is quite different from {|x| foo(x, f())} which is surprising. This has led to bugs.
  • The type system is complex enough. Bind is a weird corner case we tend to forget about. We already found one such problem (move mode arguments) and I am confident there are more lurking. Let's simplify our lives and only think about closures, which are hard enough.

As a side effect of this change, naming a method like a.b without calling it will presumably become an error.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions