Skip to content

Commit

Permalink
Added CHANGELOG entry and doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
toots committed Mar 18, 2017
1 parent 1f7b0d7 commit 86f50d1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ x.y.z ()

New:

- Added support for recursive functions (#406)

- Add peak and peak.stereo operators (#364)

- Change `track_sensitive` parameter to a boolean getter (fixed value or anonymous function).
Expand Down
27 changes: 26 additions & 1 deletion doc/content/language.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,25 @@ The constants and their syntax are quite common:

Strings might be surrounded by double or single quotes. In both cases, you can escape the quote you're using: <code>"He said: \"Hello, you\"."</code> is valid but <code>'He said: "Hello, you".'</code> is equivalent and nicer.

Also, you can include variables in a string using the <code>#{...}</code>
You can include variables in a string using the <code>#{...}</code>
syntax:
<code>"foo #{quote(my_var)} bar"</code> is equivalent to
<code>"foo " ^ quote(my_var) ^ " bar"</code>.

Finally, strings can be interpolated using the following syntax:

%%
# s = 'This is an $(name) string. \
This is a $(if $(value),"$(value)","undefined") value.';;
# s % [("name","interpolated")];;
- : string = "This is an interpolated string.This is a undefined value."
# s % [("name","interpolated"),("value","defined")];;
- : string = "This is an interpolated string.This is a defined value."
%%

Most notably, <code>output.file</code> can use string interpolation to specify a different file name
using the source's metadata.

h4. Expressions

You can form expressions by using:
Expand Down Expand Up @@ -59,6 +73,17 @@ end
# The full type of foo is ()->string.
%%

Recursive functions can be defined using the <code>rec</code> keywork:
%%(lan_rec_func.liq)
def rec fact(n) =
if n == 1 then
1
else
n * fact(n-1)
end
end
%%


**Type of an application.** The type of an application is the return type of function if all mandatory arguments are applied. With the function @foo@ previously defined, @foo()@ is a string. Otherwise, the application is "partial", and the expression still has a function type.

Expand Down

0 comments on commit 86f50d1

Please sign in to comment.