diff --git a/doc/userdoc.org b/doc/userdoc.org index af2326604a86cbbea2fbf7903fab802659a8bbff..3ef4c8f52b997d5b5d4dfe957c3b6f34f3a6c315 100644 --- a/doc/userdoc.org +++ b/doc/userdoc.org @@ -395,16 +395,36 @@ write errors. * Language -In this part we describe the grammar and data types that are - ** 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>> +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 Lists