It allows the compiler to automatically determine the type of a variable based on the assigned value.
NEMERLE
Type Inference
The keyword used to declare a variable whose value cannot be changed once assigned.
NEMERLE
def
The primary selection tool in Nemerle that allows branching based on the structure, type, or value of data.
NEMERLE
match
The keyword used to declare variables that allow for reassignment and modifications.
NEMERLE
mutable
The Polish university where Nemerle originated as an academic project in 2003.
NEMERLE
University of Wrocław
In Nemerle, the semicolon (;) is always mandatory, even if the expression is on a new line.
True or False
False – The semicolon is often optional if the expression is on a new line
Variables in Nemerle are mutable by default.
True or False
False – Variables are immutable by default unless declared with mutable.
Nemerle runs directly on hardware without a virtual execution environment.
True or False
False – Nemerle runs on the .NET Common Language Runtime (CLR), not directly on hardware.
The def keyword requires the programmer to explicitly declare the variable type
True or False
False – def enables type inference; explicit typing is optional.
Nemerle supports both object-oriented and functional programming paradigms.
True or False
True – Nemerle supports object-oriented and functional programming
What will be the output of the following code?
def a = 7; def b = 2; WriteLine(a + b * 3);
Nemerle
13
Multiplication has higher precedence. 7 + (2 * 3) = 7 + 6 = 13.
Identify the error in the following code and explain why it occurs.
def x = 5; x = 10; WriteLine(x);
Nemerle
The error occurs because x is immutable by default. Reassigning x = 10; is invalid. To fix it, declare the variable as mutable:
mutable x = 5;
Identify the problem in the following code:def name : int = "Nemerle";
Nemerle
Type mismatch error.
The variable is declared as int but assigned a string.
Analyze the return logic of the following code. In Nemerle, why is an explicit return keyword not strictly necessary in this method body?
public GetLogCount() : int
{
def count = 5;
count
}Nemerle
The last line of a block is the return value.
In Nemerle, explicit return is optional because the result of the last expression in a block is automatically returned.
What is the final boolean value of result, and which specific category of operators is being used for &&?def count = (10 > 5) && (5 == 5);
Nemerle
True
Logic (or Boolean) operators. The expression evaluates to true because both conditions are met, using the Logical AND operator.
Kamil Skalski, Michał Moskal, and Paweł Olszta.