allow records to have type annotations#8914
allow records to have type annotations#8914fdncred merged 3 commits intonushell:mainfrom 1Kinoti:record_shape
Conversation
|
We were talking about this in a recent design meeting, and we decided to move away from the or or We talked a bit about making the last one |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #8914 +/- ##
==========================================
- Coverage 68.57% 68.24% -0.34%
==========================================
Files 636 636
Lines 101772 101881 +109
==========================================
- Hits 69788 69526 -262
- Misses 31984 32355 +371
|
|
i think this is easy to fix! let me do that |
|
Nice, I'm glad it cleans up some code, too. |
|
Wrapping these shape decls for |
|
can't wait to see these new annotations in |
Not sure what you're asking, but if you are asking about reusing delimiters, you wouldn't want the same delimiter for both the argument list and the type parameters to the types. Readability improves by using two separate ones |
|
Let me take the broader question up on Discord, it's not a problem with this PR specifically. It's great for Nu to be able to annotate record and table shapes! |
|
I remember having this discussion about this change but what I don't remember is why we changed from Also, since we allow optional parentheses in custom command definition, like: i'm not sure that's more readable than this below. It kind of feels the same. But and both still read as I'm not willing to die on this hill, but I think the "alligators" <> are more intuitive than the parentheses, in this use case. Update: One big thing that I forgot to mention was that we've been considering adding function calling that looks like |
i agree with this 👍 |
|
I think the reason we're going back and forth on this is that we lack an agreed overarching model for the language. |
|
Just to 👍 what @fdncred said - after we talked about it in a recent design meeting, we realised that that We've been talking about also adding an alternative call syntax like As a result, seems like Sorry about going back and forth. |
|
and using |
no problem @jntrnr , let me do that |
|
Thanks @1Kinoti. We're close to a release (April 25), and we have a 2 day freeze before that day, so we probably won't land this until after that. I'd like to have more than a day to test it. Thanks again for all your support and PRs!!! |
|
@1Kinoti Thanks again. I'm loving this change! |
|
can't wait to play with them 🤩 |
# Description follow up to #8529 and #8914 this works very similarly to record annotations, only difference being that ```sh table<name: string> ^^^^ ^^^^^^ | | | represents the type of the items in that column | represents the column name ``` more info on the syntax can be found [here](#8914 (comment)) # User-Facing Changes **[BREAKING CHANGE]** this change adds a field to `SyntaxShape::Table` so any plugins that used it will have to update and include the field. though if you are unsure of the type the table expects, `SyntaxShape::Table(vec![])` will suffice
Description
follow up to #8529
cleaned up version of #8892
anyUser-Facing Changes
[BREAKING CHANGES]
SyntaxShape::Recordso any plugins that used it will have to update and include the field. though if you are unsure of the type the record expects,SyntaxShape::Record(vec![])will suffice