This file contains 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 "prelude.ch" | |
#include "protheus.ch" | |
/** | |
* Monadic implementation for AdvPL | |
* @author Marcelo Camargo | |
*/ | |
Class Maybe From Monad | |
Method New( xVal ) Constructor | |
Method Bind( bFun ) |
This file contains 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
<?php | |
namespace Phonebook | |
{ | |
use \Rawr\DataType\File; | |
// Blueprint for Contact | |
$contact = Object(function ($contact) | |
{ | |
$contact->has([ |
This file contains 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
window.scope = 0 | |
var replicate = function(times, char) { | |
var i, acc = ""; | |
for (i = 0; i < times; i++) | |
acc += char | |
return acc | |
} | |
var dump = function(data) { |
This file contains 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
{ map, first, last, filter, each } = require "prelude-ls" | |
export class Port | |
(@name, @port) -> | |
@listening-to-receive = [] | |
@listening-to-disconnect = [] | |
console.info "[%s] created" @name | |
@port = chrome.runtime.connect { name: @name } if not @port |
This file contains 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
%{ | |
#define yes true | |
#ignore (@) ; ignore shut up operator | |
#token T_CONSTANT_ENCAPSED_STRING("foo") T_CONSTANT_ENCAPSED_STRING("bar") | |
#translate <[T_STRING]>\<<T>\> => { | |
class { | |
public function mix(<T> $arg) { | |
test::mix($this, $arg); | |
} | |
} |
This file contains 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
/** | |
* The piping operator (|>) is based on F# and LiveScript programming languages | |
* or (|) on Shell and allows you to compose functions in a stack and has | |
* left-associativity with lower precedence. | |
*/ | |
function map(callable $fn, array $xs) { | |
$acc = []; | |
foreach ($xs as $x) { | |
$acc[] = $fn($xs); | |
} |
This file contains 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
ZEND_VM_HANDLER(173, ZEND_OF, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) | |
{ | |
USE_OPLINE | |
zend_free_op free_op1, free_op2; | |
zval *op1, *op2; | |
SAVE_OPLINE(); | |
op1 = GET_OP1_ZVAL_PTR(BP_VAR_R); | |
op2 = GET_OP2_ZVAL_PTR(BP_VAR_R); | |
FREE_OP1(); | |
FREE_OP2(); |
This file contains 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
ZEND_VM_HANDLER(173, ZEND_OF, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) | |
{ | |
USE_OPLINE | |
zend_free_op free_op1, free_op2; | |
zval *op1, *op2, *result; | |
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); | |
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); | |
do { | |
int result; |
This file contains 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
function curry$(f, bound){ | |
var context, | |
_curry = function(args) { | |
return f.length > 1 ? function(){ | |
var params = args ? args.concat() : []; | |
context = bound ? context || this : this; | |
return params.push.apply(params, arguments) < | |
f.length && arguments.length ? | |
_curry.call(context, params) : f.apply(context, params); | |
} : f; |
This file contains 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
<?php | |
/** | |
* @package unilsc | |
* @author Marcelo Camargo | |
* @since 2015/06/08 | |
* @license GNU GPL v3 | |
* P.S.: NMTBR => Not Meant To Be Readable. | |
*/ | |
ini_set('display_startup_errors',1); |