Changeset 26889 in project


Ignore:
Timestamp:
06/13/12 05:04:38 (9 years ago)
Author:
Ivan Raikov
Message:

ersatz: more cheatsheet fixes

Location:
release/4/ersatz/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/ersatz/trunk/runtime.scm

    r26880 r26889  
    983983(define (op-wordcount text kwargs)
    984984  (let ((str (unbox-string text)))
    985     (print "wordcount: str = " str)
    986985    (Tint (length (irregex-split whitespace-pat str)))))
    987986
  • release/4/ersatz/trunk/tests/tmpl/cheatsheet.tmpl

    r26880 r26889  
    100100round floor of 1.5 = {{1.5|round("floor")|int}}
    101101round ceil of 1.5 = {{1.5|round("ceil")|int}}
    102 {#
    103 
    104 join(",", list) = {{ join(",", list) }}
    105 
    106 slice with length 4 and padding value = "pad":
    107 {% for row in slice(4, "pad", long_list) %}
     102
     103join(",", [1,2,3,4,5]) = {{ join(",", [1,2,3,4,5]) }}
     104
     105{% with long_list =  [10,20,30,40,50,60,70,80,90,100] %}
     106{% for row in slice(4, long_list) %}
    108107  {% set y = loop.index %}
    109108  {% for col in row %}
     
    112111  {% endfor %}
    113112{% endfor %}
     113{% endwith %}
     114
    114115
    115116filter tag test
     
    148149{{ hoge_macro(10,20) }}
    149150
    150 {# at this point, delay_macro is not declared, but jingoo can call it. #}
     151{# at this point, delay_macro is not declared, but we can call it. #}
    151152{{ delay_macro(10,20) }}
    152153
     
    154155{{x}} {{ caller(1,2) }} {{y}}
    155156{% endmacro %}
     157{#
    156158
    157159{% call(a,b) delay_macro("from", "to") %}
     
    174176
    175177{% call subject_with_back("language", "favorite language") %}
    176 I love Ocaml.
     178I love Scheme.
    177179{% endcall %}
    178180
Note: See TracChangeset for help on using the changeset viewer.