camlspotter avatar camlspotter committed 1f3a9f8

3 colons

Comments (0)

Files changed (1)

 
 * PCRE expression and matching of Perl like syntax `$/.../`:
 
-    :::ocaml
     let f x = fun x -> x + x (Foo (1,2))
     $/regexp/
     str |! $/regexp/ -> ... | _ -> ...
 
 * Variable and expression references in string `$"..."`:
 
-        :::ocaml
         $"Your are ${name} and %{age}02d years old."
 
 * Sub-shell call by back-quotes ``$`...``: 
 
-        :::ocaml
         let status = $`wc` ~f:handle_output in ...
 
 * Easy hashtbl access `tbl${key}`:
 
-    :::ocaml
     tbl${key} <- value for Hashtbl.replace tbl key value.
 
 Some are reimplementations of existing CamlP4 extensions. ORakuda's 
 
 For easier access to functions, users are recommend to declare:
 
-    :::ocaml
     open Rakuda.Std
    
 at the begining of their source file.
 
 #### SYNTAX ####
 
-        :::ocaml
         $/regular expression/flags      (with patched P4)
         <:m<regular expression>> 
         <:m<regular expression/flags>>
 the type parameter ``'a`` encodes accessor information of the regexp's
 groups. See GROUP OBJECT METHODS for details:
 
-    :::ocaml
     # $/(hello)world(?P<name>[a-z]+)/;;
     - : < _0 : string; _1 : string; _2 : string; _group : int -> string;
           _groups : string array; _left : string;
 matching and return group objects if matches are successful. 
 The matched groups can be retrieved through them:
 
-    :::ocaml
     # let res = "123 + variable12;;" =~ $/([a-z_][_A-Za-z0-9]*)/;;
     val res :
     < _0 : string; _1 : string; _group : int -> string; _groups : string array;
 
 #### SYNTAX ####
 
-       :::ocaml
        $/regular expression/flags as var -> e
        | $/regular expression/flags as var -> e
        | ...
 PCRE case match expression is recommended to use with the pipe
 operator ``(|!)`` or ``(|>)`` (available Jane Street Core or OCaml Battries Included):
 
-     :::ocaml
      # "variable123" 
        |! $/^[0-9]+$/ as v -> `Int (int_of_string v#_0)
        |  $/^[a-z][A-Za-z0-9_]*$/ as v -> `Variable v#_0
 
 ##### SYNTAX #####
 
-        :::ocaml
         $s/regular expression/template/flags      with extended P4
         <:s<regular expression/template>>
         <:s<regular expression/template/flags>>
 
 #### SYNTAX ####
 
-        :::ocaml
         $"..."         (with patched P4)
         <:qq<...>>
     
     
 ##### EXAMPLE #####
     
-        :::ocaml
         $"... $foo123 ..."     
             Equivalent to Printf.sprintf "... %s ..." foo123
       
 
 #### SYNTAX
 
-     :::ocaml
      $`command line`         (with patched P4)
      <:qx<command line>>
 
 
 #### SYNTAX ####
   
-    :::ocaml
     tbl${key}             Hashtbl.find tbl key
     tbl${key} <- data     Hashtbl.replace tbl key data
  
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.