emilk / emilk/eon

Syntax for tuple-like enum variants

Open
#5 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
174
Forks
10
PR merge metrics
No merged PRs in 30d

Description

The readme says the syntax for something like

```rust
enum Color {
Hsl(u8, u8, u8)
}
```

is

```
"Hsl"(0, 100, 200)
```

However, shouldn't it be this?

```
"Hsl"([0, 100, 200])
```

because it's supposed to be `"tag"(data)` and a bare sequence of values is not valid data in Eon.

Now, you might say that `"Hsl"(0, 100, 200)` is a special syntax for tuple-like enum variants, but

1. Why does this in particular get a special syntax?
2. Isn't `"Hsl"([0, 100, 200])` valid syntax anyway, meaning that there are two ways to express the same thing?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.