langs a-z

This commit is contained in:
Ingy döt Net 2013-04-10 22:43:41 -07:00
parent db842d013d
commit d066446780
11389 changed files with 98361 additions and 1020 deletions

View file

@ -0,0 +1,8 @@
$ ocaml
Objective Caml version 3.12.1
# let f s1 s2 sep = String.concat sep [s1; ""; s2];;
val f : string -> string -> string -> string = <fun>
# f "Rosetta" "Code" ":";;
- : string = "Rosetta::Code"
#

View file

@ -0,0 +1 @@
$ rlwrap ocaml

View file

@ -0,0 +1,25 @@
$ octave
GNU Octave, version 3.0.2
Copyright (C) 2008 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or
FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'.
Octave was configured for "i586-mandriva-linux-gnu".
Additional information about Octave is available at http://www.octave.org.
Please contribute if you find this software useful.
For more information, visit http://www.octave.org/help-wanted.html
Report bugs to <bug@octave.org> (but first, please read
http://www.octave.org/bugs.html to learn how to write a helpful report).
For information about changes from previous versions, type `news'.
octave:1> function concat(a,b,c)
> disp(strcat(a,c,c,b));
> endfunction
octave:2> concat("Rosetta","Code",":");
Rosetta::Code
octave:3>

View file

@ -0,0 +1 @@
declare fun {F As Bs Sep} {Append As Sep|Sep|Bs} end

View file

@ -0,0 +1 @@
{System.showInfo {F "Rosetta" "Code" &:}}

View file

@ -0,0 +1 @@
f(s1,s2,sep)=Str(s1, sep, sep, s2);

View file

@ -0,0 +1,6 @@
$ rakudo/perl6
> sub f($str1,$str2,$sep) { $str1~$sep x 2~$str2 };
f
> f("Rosetta","Code",":");
Rosetta::Code
>

View file

@ -0,0 +1,8 @@
$ pike
Pike v7.8 release 352 running Hilfe v3.5 (Incremental Pike Frontend)
> string f(string first, string second, string sep){
>> return(first + sep + sep + second);
>> }
> f("Rosetta","Code",":");
(1) Result: "Rosetta::Code"
>

View file

@ -0,0 +1,10 @@
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
PS Home:\> function f ([string] $string1, [string] $string2, [string] $separator) {
>> $string1 + $separator * 2 + $string2
>> }
>>
PS Home:\> f 'Rosetta' 'Code' ':'
Rosetta::Code
PS Home:\>

View file

@ -0,0 +1,2 @@
: f ( $$$-$ ) [ ^strings'prepend ] sip ^strings'prepend ^strings'append tempString ;
"Rosetta" "Code" ":" f

View file

@ -0,0 +1,4 @@
slate[1]> s@(String traits) rosettaWith: s2@(String traits) and: s3@(String traits) [s ; s3 ; s3 ; s2].
[rosettaWith:and:]
slate[2]> 'Rosetta' rosettaWith: 'Code' and: ':'.
'Rosetta::Code'

View file

@ -0,0 +1,10 @@
$ sml
Standard ML of New Jersey v110.67 [built: Fri Jul 4 09:00:58 2008]
- fun f (s1, s2, sep) = String.concatWith sep [s1, "", s2];
[autoloading]
[library $SMLNJ-BASIS/basis.cm is stable]
[autoloading done]
val f = fn : string * string * string -> string
- f ("Rosetta", "Code", ":");
val it = "Rosetta::Code" : string
-

View file

@ -0,0 +1,5 @@
$ sh
sh-3.2$ concat() { echo "$1$3$3$2"; }
sh-3.2$ concat Rosetta Code :
Rosetta::Code
sh-3.2$

View file

@ -0,0 +1,5 @@
$ csh -f
% alias concat 'echo "\!:1\!:3\!:3\!:2"'
% concat Rosetta Code :
Rosetta::Code
%

View file

@ -0,0 +1,5 @@
$ es
; fn concat a b s { result $a$s$s$b }
; echo <={concat Rosetta Code :}
Rosetta::Code
;

View file

@ -0,0 +1 @@
RS(100, "RS(10, @1) RS(10, @3, APPEND) RS(10, @3, APPEND) RS(10, @2, APPEND)")

View file

@ -0,0 +1,2 @@
RS(1,"Rosetta") RS(2,"Code") RS(3,":") Call(100)
Message(@10)