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

atdd: recursive variants and records #397

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

elrandar
Copy link
Contributor

@elrandar elrandar commented Dec 5, 2023

  • Add support for recursive variants through the following syntax :
type record_that_uses_recursive_variant = 
{
  v: recursive_variant;
  i: int;
}

type recursive_variant <dlang shape="recursive"> = [
  | Int of int
  | Record of record_that_uses_recursive_variant
]
  • Add support for recursive records :
type recursive_class <dlang shape="recursive"> = {
  id: int;
  flag: bool;
  children: recursive_class nullable;
}
  • Add option to use enum as data type for variant without data
type planet <dlang shape="enum"> = [
  | Mercury
  | Venus
  | Earth
  | Mars
  | Saturn
  | Jupiter
  | Neptune
  | Uranus
]

Closes #392

Copy link
Collaborator

@mjambon mjambon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. If you'd like to make a release, go for it. I suggest announcing it on the Discussions board.

@elrandar
Copy link
Contributor Author

After using it for internal projects, I am not happy with the generated code in some cases, so would like to leave it open until I find the time to have an implementation I'm happy with

@elrandar elrandar mentioned this pull request Mar 4, 2024
@mjambon
Copy link
Collaborator

mjambon commented Apr 3, 2024

Marking this PR as "draft" to avoid accidental merging.

@mjambon mjambon marked this pull request as draft April 3, 2024 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

atdd: support recursive declaration through references
2 participants