| Anonymous | Login | Signup for a new account | 2013-05-23 23:03 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||
| 0002911 | OCaml | Camlp4 | public | 2004-07-06 22:17 | 2008-10-05 19:00 | ||||||
| Reporter | administrator | ||||||||||
| Assigned To | |||||||||||
| Priority | normal | Severity | feature | Reproducibility | always | ||||||
| Status | acknowledged | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Product Version | |||||||||||
| Target Version | Fixed in Version | ||||||||||
| Summary | 0002911: Camlp4 antiquotations | ||||||||||
| Description | Hello, Ça m'a pris pas mal de temps, à coup d'essais, pour trouver comment implémenter les deux fonctions ci-dessous, en particulier pour les parenthèses. Le comportement ne me semble pas tout à fait intuitif (et pas documenté, j'ai l'impression). let call_lab f l x = if l = "" then <:expr< $f$ $x$ >> else if l.[0] = '?' then let l = String.sub l 1 (String.length l - 1) in <:expr< $f$ (? $l$ : $x$) >> else <:expr< $f$ (~ $l$ : $x$) >> let abstr_lab l x res = if l = "" then <:expr< fun $lid:x$ -> $res$ >> else if l.[0] = '?' then let l = String.sub l 1 (String.length l - 1) in <:expr< fun ? $l$ : ( $lid:x$ ) -> $res$ >> else <:expr< fun ~ $l$ : $lid:x$ -> $res$ >> Ça serait pratique de pouvoir écrire simplement: <:expr< $f$ (~ $l$ : $lid:x$) >> <:expr< fun (~ $l$ : $lid:x$) -> $res$ >> et que ça marche dans les trois cas (i.e. traiter automatiquement le cas où l est vide et celui où il commence par '?'). -- Alain | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2005-11-18 10:13 | administrator | New Issue | |
| 2008-10-05 19:00 | ertai | Category | OCaml general => Camlp4 |
| 2008-10-05 19:00 | ertai | Description Updated | |
| Copyright © 2000 - 2011 MantisBT Group |