Tags "lambda" Result

Lambda returning another lambda

is there any way how to return lambda from another lambda recursively? All I want to do is finite state machine, implemented as lambda, which returns lambda implementing another state (or null). nesting Func<> won't work as I want. C#, .NET 3.5 Example: machine, 3 states, pseudolanguage private Lambda State1() { if (SomeConditionIsM

it1352 0 2019-05-10

AWS Lambda call Lambda

I'm trying to call one Lambda function from another one that I have. I set up my permissions so that is not problem. My problem is that the function doesn't wait for the Invoke function to complete and return NULL all the time. Here is the code I'm using: const AWS = require('aws-sdk'); exports.handler = async (event, context, callback) => {

it1352 0 2020-09-15


why functions created with lambda forms cannot contain statements? how to get unnamed function with statements? Solution Egor Bolonev wrote: why functions created with lambda forms cannot contain statements? syntax/technical answer: because lambda is an expression and it is not obvious how the syntax for ''statement inside expression'' should be

it1352 1 2019-06-25

java lambda returning a lambda

I am trying to do what seems to be a relatively basic thing in the new jdk8 land of functional programming but can't get it work. I have this working code: import java.util.*; import java.util.concurrent.*; import java.util.stream.*; public class so1 { public static void main() { List<Number> l = new ArrayList<>(Arrays.asLis

it1352 0 2019-05-17

C 11 lambda returning lambda

this piece of code is not something unknown to JS developers function get_counter() { return ( function() { var c = 0; return function() { return c; }; })(); } it basically creates a which creates different enumerators. So I was wondering if same thing can be done in C 11 with new lambda semantics?

it1352 2 2019-05-10

Python's argparse: How to use keyword as argument's name

lambda has a keyword function in Python: f = lambda x: x**2 2*x - 5 What if I want to use it as a variable name? Is there an escape sequence or another way? You may ask why I don't use another name. This is because I'd like to use argparse: parser = argparse.ArgumentParser("Calculate something with a quantity commonly called lambda.") parser

it1352 1 2020-09-06

Extensible macro definitions

Inspired by a comment thread on a related question regarding functions instead of macros. Is there any way to extend a Scheme syntax definition so that it can use the previous definition of the syntax in the new definition? Furthermore, this must be extensible, that is, it must be possible to chain the technique together several times. For exampl

it1352 1 2019-05-21

Writing lambda expressions in common lisp

I am currently reading ANSI Common Lisp by Paul Graham, and I have a question about writing lambda expressions. Do we need to prefix a lambda expression with #'?. If I write something like this in REPL, it will work fine > ((lambda (x) ( x 1)) 1) 2 so will this > (mapcar (lambda (x) ( x x)) '(1 2 3 4)) (2 4 6 8) I understand tha

it1352 0 2020-10-06