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
; named let for common lisp | |
(defmacro nlet (tag var-vals &body body) | |
`(labels ((,tag ,(mapcar #'car var-vals) ,@body)) | |
(,tag ,@(mapcar #'cadr var-vals)))) |
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
/** | |
* pretty print for PHP | |
*/ | |
function pp($obj, $printer = 'var_dump') | |
{ | |
if (isset($_SERVER['REQUEST_METHOD'])) echo '<pre>' . PHP_EOL; | |
$bts = debug_backtrace(false); | |
$bt = array_shift($bts); | |
echo $bt['file'] . ':' . $bt['line'] . PHP_EOL; |
NewerOlder