-
viewtypedef Int_
or_
String_vt = [b: bool]
int_
or_
string_vt b fn
print_
int_
or_
string (i_
or_s:
Int_
or_
String_vt): void = case+ i_
or_s of (* ~
indicates i_
or_s will...
- "}", }; for (
int i = 0; i < 6; i++) //
Print opening code System.out.println(l[i]); for (
int i = 0; i < l.length; i++) //
Print string array System.out...
- (real,
int,
string, void); node n := "abc"; case n in (real r):
print(("real:", r)), (
int i):
print(("
int:", i)), (
string s):
print(("
string:", s)),...
- twice(f:
Int =>
Int):
Int =>
Int = f
compose f def plusThree(i:
Int):
Int = i + 3 def main(args: Array[
String]): Unit = { val g = twice(plusThree)
print(g(7))...
- divideByTwo(_ aNum:
Int) ->
Int {
return aNum / 2 } func multiplyByTwo(_ aNum:
Int) ->
Int {
return aNum * 2 } let
mathOperation =
multiplyByTwo print(mathOperation(21))...
- programming,
string interpolation (
or variable interpolation,
variable substitution,
or variable expansion) is the
process of
evaluating a
string literal containing...
- (fun x ->
print_
int x) [1;2;3;4];;
or in
short way: List.iter
print_
int [1;2;3;4];; For arrays: Array.iter (fun x ->
print_
int x) [|1;2;3;4|];;
or in short...
-
override { callComponentDrink(); std::
print(", with {}
spoons of sugar", spoons); } private:
int spoons = 1; };
int main(
int argc, char* argv[]) { std::unique_ptr<Beverage>...
- have
longer function names such as
print_
int,
print_
string, etc. This can be seen as
advantage (more descriptive)
or a
disadvantage (overly verbose) depending...
- (real,
int, compl,
string);
Usage example for
union case of node: node n := "1234"; case n in (real r):
print(("real:", r)), (
int i):
print(("
int:", i))...