What does typeof & repr do?
I've noticed there is a selection of built-in functions, whilst most are self-explanatory repr
has me a little confused and whilst typeof
seems clear it doesn't seem to actually do anything.
I was working on adding some usage documentation when i discovered these functions, below is my work so far:
Using template-glib
Built-in functions
template-glib provides a basic set of convenience functions
Function | Takes | Does |
---|---|---|
ceil | double | Returns the smallest int >= the argument |
floor | double | Returns the largest int <= the argument |
hex | double | Returns the hex value as string |
log | double | Returns the natural logarithm (base-e) Note: This is the mathematical function log |
string | Prints the argument to stdout | |
sqrt | double | Returns the square root of the argument |
abs Not implemented |
Returns the passed number as it's positive equivalent |
Example usage
Sqrt of 25: {{sqrt(25)}}
Loops
A for loop can be used to iterate an array, the array can take the form of a GListModel or strv (more forms of array maybe added in future)
<ul>
{{for item in list}}
<li>{{item}}</li>
{{end}}
</ul>