News for hackers. Stuff that matters.
Re:Nushell.sh ls | where size > 10mb | sort-by modified by Arnavion on Sunday March 12, 2023 @04:36PM (#35125929)
Blocks always use braces. Expressions use parentheses for grouping sub-expressions. It's the same as many C-like languages. I can't imagine any situation where you would be confused which one you need to use.
Re:Nushell.sh ls | where size > 10mb | sort-by modified by marcosdumay on Sunday March 12, 2023 @04:51PM (#35126106)
> I can't imagine any situation where you would be confused which one you need to use.

Why is that test returning a boolean on the GP a block?

Re:Nushell.sh ls | where size > 10mb | sort-by modified by Arnavion on Sunday March 12, 2023 @05:14PM (#35126395)
Because it's an arbitrary piece of code that needs to be re-evaluated for every input item, like an inline function / lambda in other languages, not an expression that is evaluated once when the commandline is instantiated.
Re:Nushell.sh ls | where size > 10mb | sort-by modified by jrumbut on Sunday March 12, 2023 @04:59PM (#35126207)
Blocks always use braces, but sometimes you are passing parameters and other times you are passing a block.

If I spent all day as a PowerShell dev I'm sure I would know it, but for something I reach for once or twice a year intuitiveness is a feature I would like to have.