From 1a9203c0b515d64313595da8a05b859f4be9b196 Mon Sep 17 00:00:00 2001 From: Justus Adam Date: Thu, 29 Nov 2018 16:58:06 +0100 Subject: [PATCH] Updated dflang doc to reflect new literals and no destructuring See ohua-dev/ohua-core#19 and ohua-dev/ohua-core#24 --- source/compiler-internals/dflang.rst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/compiler-internals/dflang.rst b/source/compiler-internals/dflang.rst index de3c102..d8b5b6a 100644 --- a/source/compiler-internals/dflang.rst +++ b/source/compiler-internals/dflang.rst @@ -29,10 +29,14 @@ An example: .. code-block:: ocaml - let x (* direct assignment *) + let (x) (* target bindings *) = some.package/sf (* function ref *) <0> (* call site id *) (a, b, c) (* arguments *) in - let y = dataflow other.package/a-dataflow-fn<1>() [a] (* context arg (optional) *) in - let (z, q) (* destructure assignment *) = package/anotherSf<2>($1 (* env ref *)) in + let (y, z) = dataflow other.package/a-dataflow-fn<1>() [a] (* context arg (optional) *) in x + +In addition to local variables, such as ``a``, ``b``, ``myVar`` the arguments to +functions can also be numeric literals ``1``, ``0``, ``-4`` or references to +environment expressions. The latter are positive numbers prefixed with ``$``, +i.e. ``$1``, ``$100``.