Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -0,0 +1,3 @@
str="Hello";
str$(!str " World!"):?str;
out$!str;

View file

@ -0,0 +1,9 @@
#import system.
#symbol program =
[
#var s := String new:"Hello".
s += " World".
console writeLine:s.
].

View file

@ -0,0 +1,4 @@
iex(60)> s = "Hello"
"Hello"
iex(61)> s <> " World!"
"Hello World!"

View file

@ -0,0 +1,2 @@
(defun glue (str1 str2)
(concat str1 str2) )

View file

@ -0,0 +1,2 @@
(defun glue (str1 str2)
(format "%s%s" str1 str2) )

View file

@ -0,0 +1,3 @@
(setq str "Hello, ")
(setq str (glue str "World!") )
(insert str)

View file

@ -0,0 +1,7 @@
Strings in Forth are simply named memory locations
create astring 256 allot \ create a "string"
s" Hello " astring PLACE \ initialize the string
s" World!" astring +PLACE \ append with "+place"

View file

@ -0,0 +1,4 @@
ok
s" Hello " astring place ok
s" World!" astring +place ok
astring count type Hello World! ok

View file

@ -0,0 +1,10 @@
program main
character(len=:),allocatable :: str
str = 'hello'
str = str//' world'
write(*,*) str
end program main

View file

@ -1,3 +1,7 @@
(setq str "foo")
(push "bar" str -1)
; or as an alternative introduced in v.10.1
(extend str "bar")
(println str)

View file

@ -0,0 +1,3 @@
$str = "Hello, "
$str += "World!"
$str

View file

@ -0,0 +1,3 @@
s = "Rosetta"
s = s & " Code"
WScript.StdOut.Write s