Skip to content

Instantly share code, notes, and snippets.

require 'action_view'
require 'active_support'
require 'mustache'
class Mustache
# Remember to use {{{yield}}} (3 mustaches) to skip escaping HTML
# Using {{{tag}}} will skip escaping HTML so if your mustache methods return
# HTML, be sure to interpolate them using 3 mustaches.
(defconstrainedfn sqr
"Calculates the square of a number."
([n]
:requires
"argument must be a number"
(number? n)
"argument cannot be zero"
(not (zero? n))
:ensures