Nested function: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
(4 intermediate revisions by 3 users not shown)
Line 531:
=={{header|Ecstasy}}==
<syntaxhighlight lang="java">
module NestedFunction {
static String makeList(String separator) {
{
static String makeList(String separator)
{
Int counter = 1;
 
Line 542 ⟶ 540:
+ makeItem("second")
+ makeItem("third");
}
 
void run() {
{
@Inject Console console;
console.print(makeList(". "));
}
}
}
</syntaxhighlight>
 
Line 560 ⟶ 557:
 
=={{header|Elena}}==
ELENA 56.0x :
<syntaxhighlight lang="elena">import extensions;
Line 567 ⟶ 564:
var counter := 1;
var makeItem := (item){ var retVal := counter.toPrintable() + separator + item + (forward newLine)newLineConstant; counter += 1; ^ retVal };
^ makeItem("first") + makeItem("second") + makeItem("third")
Line 802 ⟶ 799:
=={{header|Fōrmulæ}}==
 
{{FormulaeEntry|page=https://formulae.org/?script=examples/Nested_function}}
Fōrmulæ programs are not textual, visualization/edition of programs is done showing/manipulating structures but not text. Moreover, there can be multiple visual representations of the same program. Even though it is possible to have textual representation &mdash;i.e. XML, JSON&mdash; they are intended for storage and transfer purposes more than visualization and edition.
 
'''Solution'''
 
[[File:Fōrmulæ - Nested function 01.png]]
 
[[File:Fōrmulæ - Nested function 02.png]]
Programs in Fōrmulæ are created/edited online in its [https://formulae.org website], However they run on execution servers. By default remote servers are used, but they are limited in memory and processing power, since they are intended for demonstration and casual use. A local server can be downloaded and installed, it has no limitations (it runs in your own computer). Because of that, example programs can be fully visualized and edited, but some of them will not run if they require a moderate or heavy computation/memory resources, and no local server is being used.
 
[[File:Fōrmulæ - Nested function 03.png]]
In '''[https://formulae.org/?example=Nested_function this]''' page you can see the program(s) related to this task and their results.
 
=={{header|Go}}==
Line 1,828 ⟶ 1,829:
 
=={{header|Wren}}==
<syntaxhighlight lang="ecmascriptwren">var makeList = Fn.new { |sep|
var counter = 0
var makeItem = Fn.new { |name|
9,490

edits