You can validate any of these methods to create by using the describe
command or the debug --raw
command.
Nushell Primitive | Traditional DataType | How to create in Nushell | Notes |
---|---|---|---|
Int | byte, short, int, long | let n = 1 |
|
Decimal | float, double, decimal | let d = 1.1 |
|
String | char, string | let s = "a string" |
|
Line | removed from nu | ||
ColumnPath | can't create manually | ||
GlobPattern | can't create manually | ||
Boolean | boolean | let b = $true |
|
Date | date/datetime | let d = $(date now) |
|
Duration | let d = 1min |
||
Range | let r = 1..10 |
||
FilePath | echo "some_file" | into path |
||
Filesize | let f = 1mb |
||
Binary | can't create manually | ||
Nothing | null, nil, \0 | let n = $nothing |
UntaggedValue | Traditional DataType | How to create in Nushell | Notes |
---|---|---|---|
Row | Can't create manually | ||
Table | let t = echo [[x, y, z]; [1 2 3] [4 5 6] [7 8 9]] |
||
Error | Can't create manually | ||
Block | let b = { some command } |
Traditional DataType | Nushell DataType | How to create in Nushell | Notes |
---|---|---|---|
array | see Table above |
||
list | let l = [1, 2, 4] |
||
enum | not yet | ||
record | not yet | ||
union | not yet | ||
dictionary | see Table above |
||
struct | not yet | ||
function pointer | N/A? | ||
scientific notation | N/A |