Skip to content

Commit

Permalink
Unify and nest structs and enums
Browse files Browse the repository at this point in the history
Another alternative to RFC rust-lang#5 and an extension/variant of RFC rust-lang#11.

Unify enums and structs by allowing enums to have fields, and structs to have
variants. Allow nested enums/structs. Virtual dispatch of methods on struct/enum
pointers. Remove struct variants. Treat enum variants as first class. Possibly
remove nullary structs and tuple structs.
  • Loading branch information
nrc committed Mar 30, 2014
1 parent a260073 commit 1a2093d
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions 0000-enum-struct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
- Start Date: (fill me in with today's date, YYY-MM-DD)
- RFC PR #: (leave this empty)
- Rust Issue #: (leave this empty)

# Summary

One para explanation of the feature.

# Motivation

Why are we doing this? What use cases does it support? What is the expected outcome?

# Detailed design

This is the bulk of the RFC. Explain the design in enough detail for somebody familiar
with the language to understand, and for somebody familiar with the compiler to implement.
This should get into specifics and corner-cases, and include examples of how the feature is used.

# Alternatives

What other designs have been considered? What is the impact of not doing this?

# Unresolved questions

What parts of the design are still TBD?

0 comments on commit 1a2093d

Please sign in to comment.