question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add reduce operator

See original GitHub issue

hello Guys !

the idea to add another structure to simplify code execution for example:

# is the same  1+2+3+4+5+6+7+8+9+10
PS  > :[+] 1..10
55

# use all arithmetic operator and possibility to store in variable
PS > $result = :[-] 10,32,54
PS > $result

# possibility to add personal reduce filter
PS > filter MyPersonalFilterToListAllWordBeginningByLetterh {
          if($_.tostring().StartsWith('h')) {
                $_
        }
    } 
PS> :[:MyPersonalFilterToListAllWordBeginningByLetterh] @( 'hello','lol','test','fooooo' )
hello 

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rjmholtcommented, Jan 29, 2021

I think this has already been discussed in https://github.com/PowerShell/PowerShell/issues/8098 too. See that issue for some definitions of functions that work like the proposed operator.

1reaction
iSazonovcommented, Jan 24, 2021

We already have questions to add support for LINQ and extension methods which is more promising.

Read more comments on GitHub >

github_iconTop Results From Across the Web

reduce() in Python
The reduce(fun,seq) function is used to apply a particular function passed in its argument to all of the list elements mentioned in the...
Read more >
Python's reduce(): From Functional to Pythonic Style
The idea behind Python's reduce() is to take an existing function, apply it cumulatively to all the items in an iterable, and generate...
Read more >
Array.prototype.reduce() - JavaScript - MDN Web Docs
The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this ......
Read more >
How to use Reduce() Function in Python
The above python program first calculates the sum of a given list of numbers named dummy using function operator.add that calculates the sum...
Read more >
Reduction operator
In computer science, the reduction operator is a type of operator that is commonly used in parallel programming to reduce the elements of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found