asomiya 0.2.0

Control flow

Values and types

Every value in Asomiya has one of six types. প্ৰকাৰ (prokar) tells you which.

TypeEnglish lettersExamples
সংখ্যা numberxonkhya৪২, 3.14, -৭
পাঠ textpath"নমস্কাৰ"
সঁচা-মিছা booleanxosa-misaসঁচা, মিছা
খালী emptykhaliখালী
তালিকা listtalika[১, ২, ৩]
ফাংচন functionfangchonফাংচন যোগ(ক, খ) { … }
কোৱা(প্ৰকাৰ(৪২), প্ৰকাৰ("অসম"), প্ৰকাৰ(সঁচা), প্ৰকাৰ(খালী), প্ৰকাৰ([১, ২]))
Output
সংখ্যা পাঠ সঁচা-মিছা খালী তালিকা
kowa(prokar(42), prokar("Oxom"), prokar(xosa), prokar(khali), prokar([1, 2]))
Output
xonkhya path xosa-misa khali talika

Numbers

Write numbers with Assamese digits (২৪) or ASCII digits (24), but don’t mix them in one number. Whole numbers and decimals are the same type.

কোৱা(১০ / ৪, ৭ % ৩, ২.৫ * ২)
Output
২.৫ ১ ৫
kowa(10 / 4, 7 % 3, 2.5 * 2)
Output
2.5 1 5

Text

Text goes inside double quotes. Use \n for a new line, \t for a tab and \" for a quote. See Working with text.

True and false

সঁচা and মিছা (xosa, misa) are the results of comparisons. Conditions in যদি and loops must be one of these: Asomiya has no “truthy” values, so যদি (১) is an error. This catches many mistakes early.

Converting between types

ধৰা লিখা = "৪২"
ধৰা সংখ্যাটো = সংখ্যা(লিখা)
কোৱা(সংখ্যাটো + ১)
কোৱা(পাঠ(১০) + "০")
কোৱা(পূৰ্ণাংক(৩.৯))
Output
৪৩
১০০
৩
dhora likha = "42"
dhora xonkhyato = xonkhya(likha)
kowa(xonkhyato + 1)
kowa(path(10) + "0")
kowa(purnanko(3.9))
Output
43
100
3

সংখ্যা() gives খালী if the text isn’t a number, so you can check user input safely.