Skip to content

convert SyntaxShape::Table into the corresponding Type - #7781

Merged
fdncred merged 1 commit into
nushell:mainfrom
merelymyself:main
Jan 25, 2023
Merged

fdncred merged 1 commit into
nushell:mainfrom
merelymyself:main

Conversation

@merelymyself

Copy link
Copy Markdown
Contributor

Description

Small fix. Related: #7699.

User-Facing Changes

Tests + Formatting

Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

  • cargo fmt --all -- --check to check standard code formatting (cargo fmt --all applies these changes)
  • cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect to check that you're using the standard code style
  • cargo test --workspace to check that all tests pass

After Submitting

If your PR had any user-facing changes, update the documentation after the PR is merged, if necessary. This will help us keep the docs up to date.

@fdncred

fdncred commented Jan 18, 2023 •

Copy link
Copy Markdown
Contributor

Given this def, this record parameter still works the same way. Is it supposed to?

def foo [tab: table] {
  $tab | describe
  $tab
}
> foo {a: "A", b: "B"}
record<a: string, b: string>
╭───┬───╮
│ a │ A │
│ b │ B │
╰───┴───╯

table looks better though.

> foo [[a b]; [1 2] [3, 4]] 
table<a: int, b: int>
╭───┬───┬───╮
│ # │ a │ b │
├───┼───┼───┤
│ 0 │ 1 │ 2 │
│ 1 │ 3 │ 4 │
╰───┴───┴───╯

@merelymyself

Copy link
Copy Markdown
Contributor Author

Well, a record is just a table with one row... but input from others will be appreciated.

@sholderbach sholderbach added A:type-system Problems or features related to nushell's type system semantics Places where we should define/clarify nushell's semantics labels Jan 18, 2023

@sholderbach sholderbach left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah looks good in the code

@fdncred
fdncred merged commit f9e9904 into nushell:main Jan 25, 2023
Xoffio pushed a commit to Xoffio/nushell that referenced this pull request Feb 7, 2023
# Description

Small fix. Related: nushell#7699.

# User-Facing Changes

# Tests + Formatting

Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass

# After Submitting

If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A:type-system Problems or features related to nushell's type system semantics Places where we should define/clarify nushell's semantics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants