### CyberSpy

Rantings from a guy with way too much free time

### Riding the Camel Deeper into the Desert of Code: Records and Variants

Extending and Encapsulating Data - Records and Variants Up next on our tour of OCaml are records and variants. If you are familiar with typedef, struct, and union in c/c++, you’ll quickly come to understand how to use records and variants in OCaml. We’ll start off looking at records, how to define them, use them in functions, and automatically generate common functions from our type definitions. There’s more to the eye than what you get in a language like c, so pay close attention as we move through the descriptions below. Continue reading

### Let's Get Funky with the Camel

How many ways can we get Fun(ky) In any programming paradigm, it’s critical to understand how we write functions - be they traditional imperative , anonymous , recursive, or functional. In this post, I will break down the different types of functions that you can write in OCaml. Let’s start by examining the imperative function. Here’s a simple function that prints out the phrase Hello World! $n$ times, once on each line, and returns the value $n$ as its result. Continue reading

### OCaml Hello World and more

Well Hello There! As tradition has it, every new programming language experience must begin with the basic Hello World. Let’s walk the the basics of how to set up our development environment specifically for OCaml and demonstrate how to compile our basic program. Warming up our Environment Of course we could just use our vanilla editor to enter our OCaml programs, but a more efficient work environment leverages an extensible editor that is aware of our programming language. Continue reading

### OCaml Intro: You can have it all: Object-Oriented, Imperative, and Functional

YAPL So why take the time to delve into yet another programming language? I find at worst, one can expands one’s knowledge of existing programming paradigms by studying the language design choices of other languages not used on a daily-basis. Best case, one discovers a new language that is rich in expression and productivity; thereby refining the productivity of the user. OCaml So, I tripped over this programming language in a rather random and circuitous path. Continue reading