Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://stackoverflow.com/questions/33988610/weird-behavior-of-syntax-sugarcolon-in-lua | |
local debug = require 'debug' | |
debug.setmetatable(0, { __index = math }) | |
debug.setmetatable(function() end, { __index = coroutine }) | |
debug.setmetatable(coroutine.create(function() end), { __index = coroutine }) | |
local table = require 'table' | |
table.new = function (self, t) | |
t = t or self |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <MacroVariant.hpp> | |
bool MacroVariant::isCorrectDataTypeForAction(MacroVariantType action, const std::type_info& type) | |
{ | |
switch (action) | |
{ | |
#define ADD_CASE(ACTION, PREFIX, TYPE, VALUE) \ | |
case MacroVariantType::ACTION: return typeid(std::remove_cv<PREFIX TYPE>) == type; | |
CALL_ON_EVERY_TYPE_WITH_DATA(ADD_CASE) | |
#undef ADD_CASE |
YARD CHEATSHEET http://yardoc.org
May 2020 - updated fork: https://gist.github.com/phansch/db18a595d2f5f1ef16646af72fe1fb0e
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
#/ Usage: <progname> [options]... | |
#/ How does this script make my life easier? | |
# ** Tip: use #/ lines to define the --help usage message. | |
$stderr.sync = true | |
require 'optparse' | |
# default options | |
flag = false | |
option = "default value" |