inkle / inkle/ink

Error when initializing LIST DoctorsInSurgery = (Adams, Bernard) ? Intended?

Open
#393 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.9k
Forks
540
PR merge metrics
No merged PRs in 30d

Description

The only way to initialize a list is by having parathesis ( ) around each INDIVIDUAL value.

LIST DoctorsInSurgery = (Adams), (Bernard) //Success

When modifying the list, this works:

~ DoctorsInSurgery = (Adams, Bernard) //Success

However when initializing, we can't do this:

LIST DoctorsInSurgery = (Adams, Bernard) //ERROR!

Is there a reason why the syntax this way? I think I am beginning to understand why (it's starting to make sense as I type this out) but just wanted to make sure this wasn't overlooked. It's easier to type just two ( ) around the entire LIST (ex. if you wanted to make ALL doctors in) rather than do each one individually (which is a lot of extra work if you have a huge LIST).

Contributor guide

No contributing guide indexed for this repository

Research direction

No file, test, or entry point is named. Reproduce the two LIST initialization forms and compare them with the working modification form, then trace the syntax handling to determine whether the error is intended. Done should be a clear decision about the syntax behavior and its corresponding documentation or implementation scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.