News for hackers. Stuff that matters.
Re:Pipe Operator (|>) For JavaScript by masklinn on Friday January 20, 2023 @11:42AM (#34455674)
> The Hack proposal is horrible imo because it doesn’t look like JS anymore.

I mean it looks exactly like JS with an additional % placeholder.

Re:Pipe Operator (|>) For JavaScript by mkl on Friday January 20, 2023 @05:31PM (#34461011)
And a lot more like JS than the F# proposal.
Re:Pipe Operator (|>) For JavaScript by pharmakom on Friday January 20, 2023 @06:00PM (#34461344)
How so? JS already has operators, but placeholders is a totally new concept
Re:Pipe Operator (|>) For JavaScript by mkl on Friday January 20, 2023 @06:23PM (#34461595)
Is there another JavaScript feature that looks like a list of function names but which causes actions to be performed? Or operators that operate on both functions and values? The placeholders are very similar to variables, so do what they look like they do, and it's only the implicit definition that is new. The explicit placeholders feel much more like JavaScript to me than the implicit function calling of the F# proposal.
Re:Pipe Operator (|>) For JavaScript by pharmakom on Saturday January 21, 2023 @04:05AM (#34465033)
- functions and lambdas are already first-class values in JS

- we already have operators on values, such as +

- |> is just another operator on values