What does this mean: 'x

Moderator: Konzepte der Programmiersprachen

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

What does this mean: 'x

Beitrag von saifposinc » 10. Jan 2019 22:04

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: 56
Registriert: 16. Okt 2017 12:28

Re: What does this mean: 'x

Beitrag von mirko-koehler » 11. Jan 2019 10:08

'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“