| : | فِي نِهَايَةِ السَّطْرِ تَبْدَأُ كُتْلَةٌ، وَسُطُورُهَا تَحْتَهُ مُزَاحَةٌ بِأَرْبَعِ مَسَافَاتٍ (مِثْلَ بَايْثُونَ)at the end of a line it opens a block; its lines below are indented by four spaces (like Python) |
| س = ٥ | تَعْرِيفُ مُتَغَيِّرٍ أَوْ تَغْيِيرُ قِيمَتِهِdefine a variable or change its value |
| ثابت | تَعْرِيفُ ثَابِتٍ لَا تَتَغَيَّرُ قِيمَتُهُdefine a constant, whose value never changes |
| دالة ف(س): / أرجع | تَعْرِيفُ دَالَّةٍ وَإِرْجَاعُ قِيمَةٍ مِنْهَاdefine a function and return a value from it |
| (س) -> س * 2 | دَالَّةٌ مُخْتَصَرَةٌ (سَهْمِيَّةٌ)a short (arrow) function |
| إذا ...: / وإذا ...: / وإلا: | الشُّرُوطُconditions: if / else if / else |
| بينما ...: | حَلْقَةٌ تَتَكَرَّرُ مَا دَامَ الشَّرْطُ صَحِيحًاa loop that repeats while the condition is true |
| لكل ع في ...: | حَلْقَةٌ عَلَى عَنَاصِرِ قَائِمَةٍ أَوْ نَصٍّ أَوْ كَائِنٍa loop over the items of a list, text or object |
| توقف / استمر | الْخُرُوجُ مِنَ الْحَلْقَةِ / الِانْتِقَالُ لِلدَّوْرَةِ التَّالِيَةِleave the loop / go to the next round |
| مرّر | لَا يَفْعَلُ شَيْئًا، لِكُتْلَةٍ فَارِغَةٍdoes nothing, for an empty block |
| صنف / هذا | تَعْرِيفُ صِنْفٍ، وَالْكَائِنُ الْحَالِيُّ. يَنْشَأُ الْكَائِنُ بِاسْتِدْعَاءِ الصِّنْفِ: قطة("مشمش")define a class, and the current object (this). Calling the class creates an object: قطة("مشمش") = Cat("Mishmish") |
| يرث / أصل | الْوِرَاثَةُ مِنْ صِنْفٍ آخَرَ، وَاسْتِدْعَاءُ الصِّنْفِ الْأَصْلِinherit from another class, and call the parent class (super) |
| حاول: / أمسك خ: | مُعَالَجَةُ الْأَخْطَاءِerror handling: try / catch the error as خ |
| ارمِ | إِطْلَاقُ خَطَأٍthrow an error |
| قيمة | دالة() | تَمْرِيرُ الْقِيمَةِ إِلَى الدَّالَّةِ (أُنْبُوبٌ)pass the value into the function (pipe) |