Re: Cross-language comparison: function map and similar

2017-08-24 Thread Steve D'Aprano
On Thu, 17 Aug 2017 12:53 am, Steve D'Aprano wrote: [...] > Are there language implementations which evaluate the result of map() (or its > equivalent) in some order other than the obvious left-to-right first-to-last > sequential order? Is that order guaranteed by the language, or is it an > imple

Re: Cross-language comparison: function map and similar

2017-08-20 Thread Stephan Houben
Op 2017-08-16, Steve D'Aprano schreef : > Are there language implementations which evaluate the result of map() > (or its equivalent) in some order other than the obvious left-to-right > first-to-last sequential order? Is that order guaranteed by the > language, or is it an implementation detail? >

Re: Cross-language comparison: function map and similar

2017-08-17 Thread Steve D'Aprano
On Thu, 17 Aug 2017 03:54 pm, Pavol Lisy wrote: > Is it guaranteed in python? Or future version could implement map with > something like subscriptability "propagation"? > range(1_000_000_000_000_000_000)[-1] > > map(lambda a:a+1,range(1_000_000_000_000_000_000))[-1] >

Re: Cross-language comparison: function map and similar

2017-08-17 Thread Chris Angelico
On Thu, Aug 17, 2017 at 3:54 PM, Pavol Lisy wrote: > On 8/16/17, Steve D'Aprano wrote: >> Over in another thread, we've been talking about comprehensions and their >> similarities and differences from the functional map() operation. >> >> Reminder: >> >> map(chr, [65, 66, 67, 68]) >> >> will retu

Re: Cross-language comparison: function map and similar

2017-08-16 Thread Pavol Lisy
On 8/16/17, Steve D'Aprano wrote: > Over in another thread, we've been talking about comprehensions and their > similarities and differences from the functional map() operation. > > Reminder: > > map(chr, [65, 66, 67, 68]) > > will return ['A', 'B', 'C']. > > My questions for those who know langua

Re: Cross-language comparison: function map and similar

2017-08-16 Thread Paul Rubin
Steve D'Aprano writes: > Are there language implementations which evaluate the result of map() > (or its equivalent) in some order other than the obvious left-to-right > first-to-last sequential order? Is that order guaranteed by the > language, or is it an implementation detail? Haskell just giv

Re: Cross-language comparison: function map and similar

2017-08-16 Thread Terry Reedy
On 8/16/2017 10:53 AM, Steve D'Aprano wrote: Over in another thread, we've been talking about comprehensions and their similarities and differences from the functional map() operation. Reminder: map(chr, [65, 66, 67, 68]) will return ['A', 'B', 'C']. The comprehension 'while' proposal is for fu

Re: Cross-language comparison: function map and similar

2017-08-16 Thread Rustom Mody
On Wednesday, August 16, 2017 at 8:24:46 PM UTC+5:30, Steve D'Aprano wrote: > Over in another thread, we've been talking about comprehensions and their > similarities and differences from the functional map() operation. > > Reminder: > > map(chr, [65, 66, 67, 68]) > > will return ['A', 'B', 'C']

Re: Cross-language comparison: function map and similar

2017-08-16 Thread Steve D'Aprano
On Thu, 17 Aug 2017 12:53 am, Steve D'Aprano wrote: > map(chr, [65, 66, 67, 68]) > > will return ['A', 'B', 'C']. Of course I meant ['A', 'B', 'C', 'D']. -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. -- https://mail.python.org

Cross-language comparison: function map and similar

2017-08-16 Thread Steve D'Aprano
Over in another thread, we've been talking about comprehensions and their similarities and differences from the functional map() operation. Reminder: map(chr, [65, 66, 67, 68]) will return ['A', 'B', 'C']. My questions for those who know languages apart from Python: Are there language implemen