Skip to content

Instantly share code, notes, and snippets.

@ldfallas
ldfallas / smallboogtkdrawingareatest.boo
Created April 23, 2009 13:00
A small example of creating a Gtk# DrawingArea with Boo
namespace BooGtkTest
import System
import Gtk
import Cairo
class DrawingTestWidget(DrawingArea):
public def constructor():
self.ExposeEvent += ExposeHandler
Newsqueak2
'Langexplr
'
class ShapesExperiment usingLib: platform = (
"A small experiment for using Hopscotch shape classes ."
|
CanvasDependent = platform CanvasDependent.
Presenter = platform HPresenter.
Subject = platform Subject.
@ldfallas
ldfallas / PygmentsNewspeakLexer.py
Created May 19, 2009 12:31
First(incomplete) test of creating a Pygments lexer definition for Newspeak
class NewspeakLexer(RegexLexer):
"""
For `Newspeak <http://newspeaklanguage.org/>` syntax.
"""
name = 'Newspeak'
filenames = ['*.ns2']
aliases = ['newspeak', ]
mimetypes = ['text/x-newspeak']
@ldfallas
ldfallas / FFIExperiments.ns2
Created May 25, 2009 12:26
Small experiment of using libcurl with Newspeak FFI
Newsqueak2
'LangexplrExperiments
'
class FFIExperiments usingLib: platform = (
"Experiment for calling libcurl"
|
Transcript = platform Transcript.
Alien = platform Alien.
Callback = platform Callback.
let rec MultiPartition aList (p:'a -> 'a -> bool) results =
match aList with
| x::rest ->
let equivalent,newRest =
List.partition
(fun e -> p x e)
rest
in MultiPartition newRest p ((x::equivalent)::results)
| [] -> results
+/ ((_1 * i. 2) (|. "0 1) ((p1 (*"_ 0) p2) (,"1 0) 0))
polymulti =: dyad : '+/ (((_1 * i. #y) (|. "0 1) ((x (*"_ 0) y) (,"1 1) ( ( (#y) - 1) $ 0))) , 0)'
package main
import "fmt"
type Environment struct {
bindings map[string] SExp
}
func (e Environment) Lookup(name string) SExp {
var result SExp;
namespace LangexplrExperiments
open System.Drawing
open System.Drawing.Imaging
module ImageProcExperiments = begin
let Load24BitImageData (fileName:string) =
using(new Bitmap(fileName))
(fun bm ->
if bm.PixelFormat <> PixelFormat.Format24bppRgb then
namespace LangexplrExperiments
open System.Drawing
open System.Drawing.Imaging
open Microsoft.FSharp.Math
module ImageProcExperiments = begin
let Load24BitImageData (fileName:string) =
using(new Bitmap(fileName))
(fun bm ->