Objects in Soplang
Objects in Soplang are defined using the walax
type. They store key–value pairs and provide Somali-first methods to inspect, modify, and copy structured data.
🧾 Declaring an Object – walax
declare_object.sop
walax qof = { magac: "Ayaan", da: 25, shaqo: "barayaal" }
🔧 Core Object Methods
fure()
– Get Keys
keys.sop
door keys = qof.fure() qor(keys)
qiime()
– Get Values
values.sop
door values = qof.qiime() qor(values)
lamaane()
– Get Key-Value Pairs
pairs.sop
door pairs = qof.lamaane() qor(pairs)
leeyahay(x)
– Has Key
has_key.sop
haddii (qof.leeyahay("magac")) { qor("Magaca wuu jiraa") }
tir(x)
– Delete Key
delete.sop
qof.tir("shaqo") qor(qof)
kudar(obj)
– Merge/Assign
merge.sop
walax A = {x: 1} walax B = {y: 2} walax C = A.kudar(B) qor(C) // {x: 1, y: 2}
nuqul()
– Copy
copy.sop
walax asal = {a: 10, b: 20} walax copy = asal.nuqul() qor(copy)
nadiifi()
– Clear All Properties
clear.sop
asal.nadiifi() qor("Cleared object: " + asal)
Gunaanad: walax
waxay siisaa qaab awood badan oo lagu kaydiyo xog magacyo leh, iyadoo leh habab si buuxda ugu qoran Af-Soomaali.