Introduction
Getting Started
Basic Syntax
Structures
Enumerations
Roles
User Interface
Procedures
Expressions
Translators
Contact, Questions, Discussion
Legal Notes
Updated 02/08/2018
All contents and concepts
©Webware nach Maß |
The Readable Programming Language - Handbook |
StructuresDefinitionA structure (class) is usually defined by declaring its attributes in a "has", "owns", "is made up of" or "knows" sentence. There are no methods and no class inheritance (extends). Lisilogic is user oriented, not object oriented. AttributesEach attribute (member variable) of a structure has a name and a type. They may be identical. Several sentences may add attributes to the same structure. Two attributes may not have the same name, even if one of them is a list (plural name) and the other one a single value (singular name). An attribute of a structure instance may always be empty (null), but in some cases null works like a particular value (boolean false, empty string, number 0). If no definition is found for the type of an attribute, it will be interpreted as an empty structure (without attributes). RelationshipsAttributes whose type is a structure may be owned (composition, defined in a "has", "owns" or
"is made up of" sentence) or known (reference, defined in a "knows" sentence). An instance of a structure may belong to (be owned by) at most one other structure. When a structure instance gets deleted:
Basic TypesHere's the list of the available basic types in Lisilogic. The eventual parameters of basic types (unit of numbers, max length of strings, etc.) are not mandatory. It is not possible to make lists of basic types, except email addresses. If you need a list of, say, short strings, then define a structure with a short string attribute and make a list of this structure. Conversions between basic types are automatic when they can be reasonably expected. booleanConstants: Null values (inaccessible or empty) and empty lists will be interpreted as false when put into boolean attributes or combined to booleans (with and, or, equals, ...). UI: a boolean will be edited using a checkbox, displayed as a check mark (✓) for true and a dash (-) for false in table columns, and as a disabled checkbox otherwise. whole numberParameter: unit Examples of constants: Null will be interpreted as 0. UI: a whole number will be edited using a text field and right-justified. numberParameters: number of decimals and unit 3.5 , 40.00 € , -1.3e-5 See also Basic Syntax: Numbers. Null will be interpreted as 0.0e0 (0 without a unit and without a number of decimals). UI: a number will be edited using a text field and right-justified. short stringParameter: maximum length in characters. Null will be interpreted as an empty string (""). Example of constant: Short string constants may contain calculated parts in braces ({}): UI: a short string will be edited using a text field. textParameter: maximum length in characters. Null will be interpreted as an empty string (""). Example of constant: Text constants may contain calculated parts in braces ({}). UI: a text will be edited using a text area. In the future, Lisilogic may allow rich texts (with bold, italics etc.), edited using a WYSIWYG editor. The exact possibilities will be adapted to the experience in pioneer projects. passwordExample of attribute: A password is just like a short string, except that it is never displayed, checked using a password field and edited using two password fields (the user must repeat the new password identically). email addressExample of attribute: Unlike all other basic types, it is possible to make lists of email addresses: Examples of constants: Email addresses are checked for syntax before they are stored into variables, so you may rely on the fact that email address attributes are syntactically valid. UI:
urlExample of attribute: Example of constant: Conversions: mailto: urls can be converted to email addresses and reciprocally. UI: Urls are displayed as links and edited using a text field. Only http://, https:// and mailto: urls are allowed, http:// will be added automatically if needed. dateExample of attribute: Constants: Arithmetic operations between dates and strings and dates and numbers are calculated within reasonable possibilities, see Basic Syntax: Numbers. UI: A date is displayed in English format (MM/DD/YYYY) and edited with a text field that allows also other formats (DD.MM.YYYY, YYYY-MM-DD, and different textual representations). A popup calendar is in development. timestampExample of attribute: Constants: Arithmetic operations between timestamps and strings and timestamps and numbers are calculated within reasonable possibilities, see Basic Syntax: Numbers. UI: A timestamp is displayed in English format (MM/DD/YYYY hh:mm:ss) and edited with a text field that allows also other formats (DD.MM.YYYY hh:mm:ss, YYYY-MM-DD hh:mm:ss, and different textual representations). A popup calendar is in development. EnumerationsSee the corresponding chapter: Enumerations. Double quoted constants without "the text" will be considered enumeration values and converted to short strings, texts, email addresses, dates etc. when needed. roleIs a predefined enumeration, see Roles. Predefined StructuresuserThe predefined structure user has:
You may add attributes to it. The list of roles will automatically contain the value "user" and it may not contain the value "visitor", which is reserved for people who visit the application without logging in. If you define a structure with the same name as a role, an instance of it (a role object) will be created automatically each time the role is added to a user's role list. See Roles. fileThe predefined structure file has:
You may add attributes to it. It is not possible to create a file or to set its type, size or upload_time programmatically. Files can only be uploaded. Setting the filename of a file means renaming it. The name may be corrected automatically if it contains forbidden characters or if it is already in use;
a warning will be issued. Attribute parameter: the allowed types (filename extensions) UI: files are normally displayed as a download link and edited using a file input (upload) and a "delete" checkbox.
Conversions between files and images are only made (if possible) when copying one of them. So it is possible to add an image to a list of files if this list is an owned attribute, but not if it is a known (reference) attribute. The same applies to single value attributes. imageThe predefined structure image has:
You may add attributes to it. It is not possible to create an image or to set its width, height, size or upload_time programmatically. Images can only be uploaded. Setting the filename of an image means renaming it. The name may be corrected automatically if it contains forbidden characters or if it is already in use; a warning will be issued. Attribute parameters: min size, max size, thumbnail size, min width, max width, thumbnail width, min height, max height, thumbnail height, all in px. UI: images are normally displayed as their thumbnail with a download link, and edited using a file input (upload) and a "delete" checkbox.
Conversions between files and images are only made (if possible) when copying one of them. So it is possible to add an image to a list of files if this list is an owned attribute, but not if it is a known (reference) attribute. The same applies to single value attributes. applicationThe application is a predefined structure that has only one instance (singleton pattern). It has no predefined attributes, you may extend it to store global data. It is not possible to create or delete an application or to store it in an attribute that owns its content. sessionAn instance of the session is created and destroyed automatically with each web session. It will be destroyed if the user logs out, but not upon login. It has no predefined attributes, you may extend it to store temporary data, for instance to perform checks on edited values before storing them
in the database. |