Recent Changes - Search:

Oktatás

* Programozás 1
  + feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

Teaching

Programming 1 (BI)
  ▸ exercises
  ▸ quick link

teaching assets


Félévek

* 2025/26/2
* archívum


Linkek

* kalendárium
* tételsorok
* jegyzetek
* szakdolgozat / PhD
* ösztöndíjak
* certificates
* C lang.
* C#
* D lang.
* Java
* Nim
* Nim2
  + exercises
* XC=BASIC
* old
  ✦C++, ✦Clojure, ✦Scala


[ edit | logout ]
[ sandbox | passwd ]

lambda function

(1) without lambda
import std.stdio;

string[] makeFruits()
{
    auto result = ["apple", "kiwi"];
    result ~= "banana";
    return result;
}

void main()
{
    const fruits = makeFruits();
    writeln(fruits);
}

We call a function that has a name. The function returns a list.

(1) WITH lambda
import std.stdio;

void main()
{
    const fruits = {
        auto result = ["apple", "kiwi"];
        result ~= "banana";
        return result;
    }();  // we call it

    writeln(fruits);
}

Here, we define a no-name (anonymous) function (a lambda function), and we call it (notice the () at the end). Similarly to the previous example, it also returns a list that we store in a variable.

Cloud City

  

Blogjaim, hobbi projektjeim

* The Ubuntu Incident
* Python Adventures
* @GitHub
* heroku
* extra
* haladó Python
* YouTube listák


Debrecen | la France


[ edit ]

Edit - History - Print *** Report - Recent Changes - Search
Page last modified on 2025 August 16, 16:18