Paste number 60614: Example Code

Paste number 60614: Example Code
Pasted by: jdrake
5 days, 1 hour ago
None
Paste contents:
Raw Source | XML | Display As

(* type shape = Circle ... | Square ... | Scene of scene and scene = shape list
 type scene = Circle ... | Square ... | Scene of scene list *)

type shape = None | Circle of float * float * float
type scene = None | Scene of shape list

(*
let append shape =
    function Scene sl -> Scene (shape::sl)
             | s2 -> Scene [shape;s2] *)
             
let sceneAppend (Scene sl) shape = Scene (shape::sl)
let sceneAppend shapeA shapeB = Scene [shapeA;shapeB]

let main () =
    if not !Sys.interactive then
        Sdl.init [`VIDEO];
        at_exit Sdl.quit;
    
        let screen = Sdlvideo.set_video_mode 640 640 [`DOUBLEBUF] in
            Sdlvideo.flip screen    

let _ = main ()

This paste has no annotations.

Colorize as:
Show Line Numbers

Ads absolutely not by Google

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.