/* cduce --compile tiki_of_html.cd cduce --run tiki_of_html.cdo --arg http://digicosme.lri.fr/innovation.html */ let tiki_of_html (h : [ Any* ]) : [Byte*] = /* Applique le pattern a chaque element de la liste. l'expression de droite doit etre une liste, et le tout est reconcaténé: Équivalent de List.concat (List.map f l) où f est la transformation faite par le pattern */ transform h with /* on ignore le header */
_ -> [] /* Le gras */ | (l&[Any*]) -> "__" @ tiki_of_html l @ "__" /* Les liens */ | (l&[Any*]) -> "[" @ url @ "|" @ tiki_of_html l @ "]" /* Les listes non */ | <((`ul|`ol)&tag) ..>(l&[Any*]) -> let sym = if tag = `ol then "# " else "* " in let res = transform "\n" @ l with