-
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)),...
-
format string parameter and a
variable number of
value parameters that the
function serializes per the
format string and
writes to an
output stream or a string...
- 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))...
- 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...
- foo_
print(Ts... args) { ((std::cout << args << ' '), ...); }
int main() { std::cout << std::boolalpha; foo_
print(1, 3.14f); // 1 3.14 foo_
print("Foo"...
-
succinct way to do the same thing.
int main() { std::vector<Employee> emps; /* code to po****te
database */
const std::
string sort_field = "idnum"; std::sort(emps...
- programming,
string interpolation (
or variable interpolation,
variable substitution,
or variable expansion) is the
process of
evaluating a
string literal containing...