Re: Lambda in parameters

2020-12-19 Thread Abdur-Rahmaan Janhangeer
Greetings list, Jane Street is well known for its love of functional programming in general and of OCaml in particular. If you don't know OCaml yet, I highly recommend it. You can think of it as Python with (static) types. Yes i know OCaml when i was exploring haskell and the like. At that tim

Re: Lambda in parameters

2020-12-19 Thread Abdur-Rahmaan Janhangeer
Greetings list, Why car and cdr? Well obviously car is content of the address register and cdr is content of data register. Apparently an artefact of a early implementation of lisp. Oh did not know that detail. More twists for sure. Thought lisp did not go lowlevel. Kind Regards, Abdur-Rahma

Re: Lambda in parameters

2020-12-19 Thread Abdur-Rahmaan Janhangeer
Greetings, Very clear explanations, rewriting lambdas as a function was the key to understand it. Did not know was a lisp inspiration. My mind still spiralling XD Kind Regards, Abdur-Rahmaan Janhangeer about | blog github

Re: Lambda in parameters

2020-12-19 Thread Greg Ewing
On 18/12/20 7:02 pm, Cameron Simpson wrote: Frankly, I think this is a terrible way to solve this problem, whatever the problem was supposed to be - that is not clear. It demonstrates that a programming language doesn't strictly need data structes -- you can do everything with nothing but funct

Re: Lambda in parameters

2020-12-19 Thread Cameron Simpson
On 19Dec2020 07:39, Philippe Meunier wrote: >See also the example reduction >here: https://en.wikipedia.org/wiki/Church_encoding#Church_pairs Thank you for this reference. I've stuck it on my reading list. Cheers, Cameron Simpson -- https://mail.python.org/mailman/listinfo/python-list

Delegating to part of a subgenerator

2020-12-19 Thread Paolo Lammens
Dear all, I've been struggling with the following problem, and I thought maybe there is someone here in python-list who could shine some light on this. Suppose we have a generator function `subgen`, and we want to wrap this in another generator function, `gen`. For clarity, these are "full" gener

Re: Lambda in parameters

2020-12-19 Thread Philippe Meunier
Abdur-Rahmaan Janhangeer wrote: >The aim of car is to return 1 >but i don't understand how lambda achieves this Cameron Simpson's explanation is very good. See also the example reduction here: https://en.wikipedia.org/wiki/Church_encoding#Church_pairs >This problem was asked by Jane Street. Jan

Re: Function returns old value

2020-12-19 Thread Michael F. Stemper
On 18/12/2020 00.09, Cameron Simpson wrote: On 17Dec2020 14:22, Michael F. Stemper wrote: On 17/12/2020 03.57, Peter J. Holzer wrote: On 2020-12-17 03:06:32 -, Bischoop wrote: With newer vims that's rarely necessary though since they can distinguish between input that was pasted and inp