# Changes in /[bcef6c8:eaa1759]

Ignore:
File:
1 edited

Unmodified
Removed
• ## doc/papers/general/Paper.tex

 rbcef6c8 Alternative call syntax (literal argument before routine name) to convert basic literals into user literals. {\lstset{language=CFA,deletedelim=**[is][]{}{},moredelim=**[is][\color{red}]{@}{@}} {\lstset{language=CFA,moredelim=**[is][\color{red}]{|}{|},deletedelim=**[is][]{}{}} \begin{cfa} struct Weight { double stones; }; Weight ?+?( Weight l, Weight r ) { return (Weight){ l.stones + r.stones }; } Weight @?st@( double w ) { return (Weight){ w }; } $\C{// backquote for units}$ Weight @?lb@( double w ) { return (Weight){ w / 14.0 }; } Weight @?kg@( double w ) { return (Weight) { w * 0.1575}; } Weight |?st|( double w ) { return (Weight){ w }; } $\C{// backquote for units}$ Weight |?lb|( double w ) { return (Weight){ w / 14.0 }; } Weight |?kg|( double w ) { return (Weight) { w * 0.1575}; } int main() { Weight w, hw = { 14 };                                  $\C{// 14 stone}$ w = 11@st@ + 1@lb@; w = 70.3@kg@; w = 155@lb@; w = 0x_9b_u@lb@;                                               $\C{// hexadecimal unsigned weight (155)}$ w = 0_233@lb@;                                                 $\C{// octal weight (155)}$ w = 5@st@ + 8@kg@ + 25@lb@ + hw; w = 11|st| + 1|lb|; w = 70.3|kg|; w = 155|lb|; w = 0x_9b_u|lb|;                                               $\C{// hexadecimal unsigned weight (155)}$ w = 0_233|lb|;                                                 $\C{// octal weight (155)}$ w = 5|st| + 8|kg| + 25|lb| + hw; } \end{cfa}
Note: See TracChangeset for help on using the changeset viewer.