Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic classes: use cases, struct literals, struct types, and future work #561

Merged
merged 83 commits into from
Aug 9, 2021
Merged
Changes from 1 commit
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
f4a7568
Filling out template with PR 561
josh11b Jun 2, 2021
ed189a9
Fill in proposal template
josh11b Jun 3, 2021
f03e0d6
Checkpoint progress.
josh11b Jun 3, 2021
815ee7b
Filling out template with PR 561
josh11b Jun 2, 2021
2c26238
Fill in proposal template
josh11b Jun 3, 2021
5304872
Checkpoint progress.
josh11b Jun 3, 2021
e914354
Update README.
josh11b Jun 3, 2021
cd5b3c2
Merge remote-tracking branch 'refs/remotes/origin/structs-2' into str…
josh11b Jun 3, 2021
7e3933b
Checkpoint progress.
josh11b Jun 3, 2021
4babbcb
Checkpoint progress.
josh11b Jun 4, 2021
5b441c8
Filling out template with PR 561
josh11b Jun 2, 2021
6239f7a
Fill in proposal template
josh11b Jun 3, 2021
12e08df
Checkpoint progress.
josh11b Jun 3, 2021
4895b04
Update README.
josh11b Jun 3, 2021
aa48975
Checkpoint progress.
josh11b Jun 3, 2021
ff68585
Checkpoint progress.
josh11b Jun 4, 2021
c544b0a
Merge branch 'structs-2' of github.com:josh11b/carbon-lang into struc…
josh11b Jun 22, 2021
e9827b3
Iterate on use case text.
josh11b Jun 22, 2021
ba73b43
Checkpoint progress.
josh11b Jun 25, 2021
a5ac27f
Checkpoint progress.
josh11b Jun 25, 2021
25cf0b7
Use cases are in pretty good shape now.
josh11b Jun 25, 2021
7869741
Checkpoint progress.
josh11b Jun 25, 2021
8972a40
First complete version.
josh11b Jun 26, 2021
a703cbd
Checkpoint progress.
josh11b Jun 26, 2021
303fcd5
Merge remote-tracking branch 'upstream/trunk' into structs-2
josh11b Jun 26, 2021
dae391f
Replace "parent/child" with "base/derived type".
josh11b Jun 28, 2021
3a58e7f
Further fix terminology.
josh11b Jun 28, 2021
21a9923
Apply suggestions from code review
josh11b Jun 28, 2021
65b0d39
Use "anonymous" and "nominal" instead of "(un)named"
josh11b Jun 28, 2021
34fd7ba
Better rationale for distinct syntax for types.
josh11b Jun 28, 2021
ca48a17
Address syntax ambiguity of `{`
josh11b Jun 29, 2021
6f94997
Add non-virtual inheritance, TODOs, clarification
josh11b Jun 30, 2021
bd34505
Rename "data type" to "data class"
josh11b Jun 30, 2021
09679f3
Fix formatting and linking.
josh11b Jun 30, 2021
da2d0f8
Difference and overlap between ABC and polymorphic types.
josh11b Jun 30, 2021
13f4f2d
Clarify polymorphic types based on review
josh11b Jun 30, 2021
96bb407
May support ABCs long term
josh11b Jun 30, 2021
2703122
New name for ABCs?
josh11b Jul 1, 2021
b2b2314
Resolution of #494 and `alias`->`let`
josh11b Jul 7, 2021
a7d6fbb
Questions about `let`
josh11b Jul 7, 2021
6e161e9
Part way through redoing use cases
josh11b Jul 14, 2021
4690658
Checkpoint progress.
josh11b Jul 14, 2021
48181d5
Checkpoint progress.
josh11b Jul 15, 2021
2b56c8a
Checkpoint progress.
josh11b Jul 16, 2021
f36ce10
Apply suggestions from code review
josh11b Jul 20, 2021
5cb3318
Apply suggestions from code review
josh11b Jul 20, 2021
8dd821f
Fix line breaks
josh11b Jul 20, 2021
aa0bad5
Incorporate suggestion
josh11b Jul 20, 2021
85cbed7
Big fixes to use cases, add computed properties
josh11b Jul 23, 2021
46ae873
Updates to the last half
josh11b Jul 23, 2021
86941fa
Anonymous type declarations are really just type expressions
josh11b Jul 23, 2021
4be36a1
Implementing interfaces for data classes
josh11b Jul 23, 2021
f0ac344
Expand alternatives considered
josh11b Jul 23, 2021
e4e83d5
Open questions about assign and init
josh11b Jul 24, 2021
2dd640c
Merge remote-tracking branch 'upstream/trunk' into structs-2
josh11b Jul 24, 2021
7cbb93b
Updates
josh11b Jul 24, 2021
201649a
Mixin open questions
josh11b Jul 28, 2021
1fe6d52
Answer an open question
josh11b Jul 28, 2021
d3c6590
Tuples act like data classes for blanket interface impl
josh11b Jul 30, 2021
3e3b6e4
Include resolution of issues #651 and #653
josh11b Jul 30, 2021
7f5abad
`struct` -> `class` in README
josh11b Jul 30, 2021
c856bee
Rename structs.md to classes.md
josh11b Jul 30, 2021
9f7cf2b
struct -> class
josh11b Jul 30, 2021
ccf0f4d
struct -> class in proposal
josh11b Jul 30, 2021
bb3abb8
Clarify that struct types are a subset of data class types
josh11b Jul 30, 2021
0d0aa69
struct -> class in generics design docs
josh11b Jul 30, 2021
2c4e1d5
Fix old `struct` refs, `struct` is not a keyword
josh11b Aug 1, 2021
79794d2
Use for properties from KateGregory
josh11b Aug 3, 2021
f865d76
Apply suggestions from code review
josh11b Aug 3, 2021
2477335
Fix formatting
josh11b Aug 3, 2021
0939ce3
Update problem statement in proposal
josh11b Aug 3, 2021
80eb33c
Match `impl` syntax from #575.
josh11b Aug 3, 2021
0913cbd
"class" instead of "`class`"
josh11b Aug 4, 2021
f66dbfa
Small fixes to "access control" alternatives
josh11b Aug 5, 2021
3543e28
Apply suggestions from code review
josh11b Aug 5, 2021
dc1e48f
Comparisons question is now #710.
josh11b Aug 5, 2021
95c9aa5
Merge branch 'trunk' into structs-2
josh11b Aug 5, 2021
0dc39ea
Fix formatting
josh11b Aug 5, 2021
eae9b5e
Move struct field defaults and option parameters to future work
josh11b Aug 6, 2021
7e04407
Allow trailing comma
josh11b Aug 7, 2021
68720ec
Update docs/design/classes.md
josh11b Aug 7, 2021
ff1c37b
Empty `{}` case, fix formatting
josh11b Aug 7, 2021
85587dc
No `{,}`
josh11b Aug 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fill in proposal template
josh11b committed Jun 3, 2021
commit 2c2623841153d494d49706aef90ceb1becfd24c3
28 changes: 12 additions & 16 deletions proposals/p0561.md
Original file line number Diff line number Diff line change
@@ -15,38 +15,34 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- [Problem](#problem)
- [Background](#background)
- [Proposal](#proposal)
- [Details](#details)
- [Rationale based on Carbon's goals](#rationale-based-on-carbons-goals)
- [Alternatives considered](#alternatives-considered)

<!-- tocstop -->

## Problem

TODO: What problem are you trying to solve? How important is that problem? Who
is impacted by it?
We need to say how you define new types in Carbon. This proposal is specifically
about [record types](<https://en.wikipedia.org/wiki/Record_(computer_science)>).

## Background

TODO: Is there any background that readers should consider to fully understand
this problem and your approach to solving it?
This is a replacement for earlier proposal #98.
josh11b marked this conversation as resolved.
Show resolved Hide resolved

## Proposal

TODO: Briefly and at a high level, how do you propose to solve the problem? Why
will that in fact solve it?

## Details

TODO: Fully explain the details of the proposed solution.
This proposal adds an initial design for record types called "structs",
including anonymous structs and anonymous struct literals. The design is
replacing the skeletal design present in
[this document](/docs/design/structs.md).

## Rationale based on Carbon's goals

TODO: How does this proposal effectively advance Carbon's goals? Rather than
re-stating the full motivation, this should connect that motivation back to
Carbon's stated goals for the project or language. This may evolve during
review.
This particular proposal is focusing on
[the Carbon goal](/docs/project/goals.md#code-that-is-easy-to-read-understand-and-write)
that code is "easy to read, understand, and write." Future proposals will
address other aspects of the `struct` design such as performance.

## Alternatives considered

TODO: What alternative solutions have you considered?
See earlier proposal #98.