Here's my current programming question, for those Perlites out there. I have two ananymous subroutine references, stored in local variables. I want to create a new anonymous subroutine that runs both of those other subroutine. How do I do it?
In [67]: (lambda a: (lambda b: a*b))(3, 7)
TypeError: <lambda>() takes 1 positional argument but 2 were given
<lambda>() takes 1 positional argument but 2 were given
@PhiNotPi as an excercise, using the pattern (lambda f: f(f))(lambda f: ___________________), can you now write a function that takes a list of integers, and returns their sum?
@PhiNotPi seems like you have died and/or are gone, either way, what I just explained to you (in googlable terms) is the Y combinator, currying, and part of the lambda calculus
if, or cond, or whatever your conditional evaluation might look like in your language is not necessarily a primitive (or in lisp, a special form), and can be derived from other constructs
it's probably not a good sign for the language i designed if i, the person who understands it the best in the world almost certainly, write programs in it and then throw my hands in the air saying "it works and i don't know how but i'm done touching it"
In mathematics, Church encoding is a means of representing data and operators in the lambda calculus. The data and operators form a mathematical structure which is embedded in the lambda calculus. The Church numerals are a representation of the natural numbers using lambda notation. The method is named for Alonzo Church, who first encoded data in the lambda calculus this way.
Terms that are usually considered primitive in other notations (such as integers, booleans, pairs, lists, and tagged unions) are mapped to higher-order functions under Church encoding. The Church-Turing thesis asserts that...
@ChrisJester-Young I believe JIT can be a viable strategy in some niche cases (like really extreme workloads with lots of 'happy paths'), but I believe the default should be AOT, with JIT available on request by the user