Recent Changes - Search:

Oktatás

* Programozás 2
  + feladatsor
  + C feladatsor
  + Python feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

* Adator. prog.
  + feladatsor
  + quick link

Teaching

* Prog. for Data Sci. (TODO)

teaching assets


Félévek

* 2025/26/1
* archívum


Linkek

* kalendárium
   - munkaszüneti napok '20
* tételsorok
* jegyzetek
* szakdolgozat / PhD
* ösztöndíjak
* certificates
* C lang.
* C++
* C#
* Clojure
* D lang.
* Java
* Nim
* 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