What does this mean: 'x

Moderator: Konzepte der Programmiersprachen

saifposinc
Neuling
Neuling
Beiträge: 7
Registriert: 10. Dez 2018 19:20

What does this mean: 'x

Beitrag von saifposinc »

val someTerm: Lambda = Lambda(
parameter = Identifier('x),
body = Identifier('x)
)

Above is a snippet of code from the 'Scala Introductory Class'. I'm not understanding what 'x means.
Can anyone please explain a bit.
Thanks.

mirko-koehler
Moderator
Moderator
Beiträge: 82
Registriert: 16. Okt 2017 12:28

Re: What does this mean: 'x

Beitrag von mirko-koehler »

'x is a symbol, see https://www.scala-lang.org/api/2.12.1/scala/Symbol.html.

We use symbols to name variables or parameters in our languages, e.g. Lambda(parameter = Identifier('x), body = Identifier('x)) would be the lambda term \(\lambda x . x\).

Antworten

Zurück zu „Konzepte der Programmiersprachen“