Skip to content
Snippets Groups Projects
Commit a029ab08 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Begin language doc [ci-skip]

parent 92de3f2f
Branches
Tags
1 merge request!145git subrepo clone git@gitlab.com:OlMon/org-themes.git packages/org-themes
...@@ -395,16 +395,36 @@ write errors. ...@@ -395,16 +395,36 @@ write errors.
* Language * Language
In this part we describe the grammar and data types that are
** Variables ** Variables
*** TODO Declaration In order to simplify the presentation, before going further, we
introduce the construction that allow to print data to the
terminal. It follows ~C++~ streams construction for convenience. For
instance
#+NAME: cout-preamble-example
#+BEGIN_SRC pugs :exports both :results output
cout << "2+3 = " << 2+3 << "\n";
#+END_SRC
produces the following output
#+results: cout-preamble-example
The code is quite obvious for ~C++~ users, note that ~"\n"~ is the
linefeed string (there is no character type in ~pugs~, just strings).
Actually, ~cout~ is itself a variable, we will come to this later.
*** TODO Affectation ~pugs~ is a strongly typed language. It means that a variable *cannot*
change of type in its lifetime.
*** TODO Basic types<<basic-types>> *** TODO Basic types<<basic-types>>
Basic types in ~pugs~ are boolean ~B~, natural integers ~N~, integers ~Z~,
real ~R~, small vectors ~R^1~, ~R^2~ and ~R^3~, small matrices ~R^1x1~, ~R^2x2~
and ~R^3x3~ and strings ~string~.
*** TODO Declaration and affectation syntax
*** TODO High-level types<<high-level-types>> *** TODO High-level types<<high-level-types>>
*** TODO Lists *** TODO Lists
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment