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
;; Possible bug, or at least unexpected behavior, for typed array | |
;; literals. Demonstration below. The same storage is used | |
;; for the same literal. | |
;; | |
;; Run on guile (GNU Guile) 2.0.5 on Mac OS X. | |
;; | |
;; Shane Celis | |
(define x #f64(0. 1. 2.)) | |
(define y #f64(0. 1. 2.)) | |
;; Set the first element of x to 1. |
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
/* | |
This file demonstrates a bug with C goto labels and Guile. | |
$ gcc `pkg-config guile-2.0 --cflags --libs` goto_label_bug.c -o goto_label_bug | |
goto_label_bug.c: In function 'main': | |
goto_label_bug.c:10: error: expected expression before 'SCM' | |
$ gcc `pkg-config guile-2.0 --cflags --libs` goto_label_bug.c -o goto_label_bug -D INSERT_NOOP | |
$ # No problem. |
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
/* | |
This file exhibits a lots of warnings in a C file that calls GNU | |
Guile. The warnings are shown only when there is a compilation error. | |
Shane Celis | |
*/ | |
#include <libguile.h> | |
#define C_STRING_TO_SYMBOL(str) scm_string_to_symbol(scm_from_locale_string(str)) |
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
(define (make-trampoline module name) | |
"Creates a trampoline out of a symbol in a given module, e.g. (lambda () (name))" | |
(let ((var (module-variable module name))) | |
(unless var | |
(scm-error 'no-such-variable "make-trampoline" "Can't make a trampoline for variable named '~a that does not exist in module ~a." (list name module) #f)) | |
(let ((proc (lambda () ((variable-ref var))))) | |
(set-procedure-property! proc 'name | |
(string->symbol (format #f "~a-trampoline" name))) | |
proc))) |
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
;; define-with-source.scm | |
;; | |
;; An attempt at making the source code for procedures easy to track | |
;; down at runtime. Useful for Emacsy when aping the self-documenting | |
;; system in Emacs. | |
;; | |
;; Shane Celis | |
(define-module (define-with-source) | |
#:use-module (ice-9 optargs) |
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
such combinator much lambda | |
quiet | |
Y = λf.(λx.f (x x)) (λx.f (x x)) | |
loud | |
such y much f | |
very a is plz f with f | |
wow a | |
such x much f | |
such z with x | |
very b is plz f with f |
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
;; Simple Emacs utility function to lookup Unity API references by Shane Celis. | |
(defun unity-api-lookup (string) | |
"Opens up a browser to Google's first hit for the search string 'unity api reference ' plus your search term." | |
(interactive (list | |
(read-string "Look up Unity API reference for: " | |
(thing-at-point 'word) 'unity-api-lookup-history))) | |
(browse-url (concat "http://www.google.com/search?btnI&q=" | |
(url-hexify-string | |
(concat "unity api reference " string))))) |
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
/* | |
CoroutineTests.cs -- Shane Celis | |
I was curious about how one could manually drive Unity's coroutines | |
without necessarily putting them into Unity's scheduler. At the | |
heart of it, it's really easy to manually drive them: | |
// Get the coroutine. | |
IEnumerator ienum = MyCoroutine(); | |
// Run it until it yields. |
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
(defun dired-open-by-macosx () | |
"Opens a file in dired with the Mac OS X command 'open'." | |
(interactive) | |
(shell-command (concat "open " (shell-quote-argument (expand-file-name (dired-file-name-at-point)))))) | |
(define-key dired-mode-map (kbd "O") 'dired-open-by-macosx) |
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
;;; minimap.el --- Sidebar showing a "mini-map" of a buffer | |
;; Copyright (C) 2009-2014 Free Software Foundation, Inc. | |
;; Author: David Engster <[email protected]> | |
;; Keywords: | |
;; Version: 1.2 | |
;; This file is part of GNU Emacs. |