ASPL لباتASPL 0.7.0

Search documentation

Search starts with current English documentation · ASPL 0.7.0

Enter a complete name such as read_line, or words about a topic.

    العربية
    Source files

    Open one UTF-8 .aspl or .لبات file, up to 1 MiB, in a new draft. It stays in this browser and does not run automatically.

    Types and control flow

    ASPL 0.7.0 · Current release

    Types, initialized bindings, conditions, and loops in 0.7.0.

    On this page

    Exact types

    There are no implicit conversions. Every typed numeric value keeps its exact width and signedness. Operations need matching operand types, and boundaries and aggregates do not convert values. The only conversion applies a numeric type name explicitly, such as ط8(value) or u8(value), and it can trap when the value is not representable. ص64/i64 remains the type for the entry result, indexes, lengths, and Unicode bounds. Strings are immutable, c_ptr is opaque and nullable, and unit cannot be stored. Initialized bindings may infer their type, if, while require booleans, and return must match its declared result.

    The other basic aliases are منطقي / bool, نص / string, مؤشر_سي / c_ptr, and وحدة / unit. Boolean literals are صواب / true and خطأ / false; the null pointer is عدم / null. Equality needs matching types; strings compare exact UTF-8 bytes and pointers compare identity. unit cannot be stored, passed as a value, or compared.

    Bindings

    دع / let is immutable and متغير / var allows assignment. Every binding needs an initializer. Write a type after : or let checking infer it. Shadowing is forbidden. Typed numbers never convert implicitly, including inside lists, records, or results. 0.7.0 also has list<T>, result<T>, records, and callable values, extending the MVP basic types.

    Control flow and evaluation

    Conditions must be bool. و / and and أو / or short-circuit; ! negates a Boolean. Operands, arguments, and initializers evaluate left to right. Assignment finishes its right side before changing its target. إذا / if, وإلا / else, and طالما / while use lexical blocks. There is no break or continue. Every path through a non-unit function must return its declared type. An if proves a return when both branches return; a while never proves one. Structurally unreachable code is rejected.

    Sum prints 55\n and returns status 0. Diagnostic and correction demonstrates immutable assignment rejection.

    Release scope and related reading

    This page describes ASPL 0.7.0. The linked MVP text is a historical record, not a complete description of current extensions.

    Browse pages