Introduction / JM°'s Super Cräfte


JM°'s super powers

Allgemein und JM°-Classic

Erzeugen von Objekten

# Integer
12345
# String
"foo"
# Objekt aus einem Typ (kein 'new' nötig)
Random

Variablen und Konstanten

# Variable
abc = 'c'
# Konstante
GHI = 123

Date and time

lastWeek = Date - 7
tomorrow = Date + 1
diff = Time(8,17) - Time(4,9)

Flexible positions

list = [4,7,9]
Print list[2]
Print list[-1]

Integrated event system

# Event erzeugen
::@event
# Event-Handler definieren
this::@event
	"Gestartet".print
# Event starten
this.@event

JM°-Flow

Ranges

'a'..'h'
	it.print

Processing chains

# Zufallszahl erzeugen, multiplizieren, ausgeben und zuweisen
Random.int(2,9).mul(3).print => x
# Textbearbeitung
"Dies ist ein Text".split(' ').each.lower.replace('x', 's').capital.print
# In-Line-Schleife
5.times.toStr.begin("--> ").add(".Punkt").print

Funktional

rawList = [3,2,7,8,10,1,5,9,4]
lowList = rawList.filter( each <=5 )

Iteration durch eine Liste

list = [6,7,5,8,1,2,7]
list.each.print

Framework austauschen

>prefix = "Swing"

b = _Button( "Okay" )
_Main.add( b ).size(600,400).title("This is awesome!").run
>prefix = "SWT"

b = _Button( "Okay" )
_Main.add( b ).size(600,400).title("This is awesome!").run

Flexible assignment of variables

v = 4
v.let(4)
4 => v
4.mem(:v)

Events for variables

a::@varChanged
	("Geändert zu " + it).print
a = 2

Multi-Call

::test(a, b)
	(a+b).print

this.test(3.times..., 2.times...)


- Powered by OghsWiki -

 

 

Sponsor

The development of "JayMo" is currently only possible through personal initiative.

Received:  0 €