Skip to content

Instantly share code, notes, and snippets.


Tobias Dammers tdammers

View GitHub Profile
View This.hs
{-#LANGUAGE TemplateHaskell #-}
module This where
import Language.Haskell.TH
runIO $ putStrLn "The Eightfold Path To Monad Satori, by Stephen Diehl"
runIO $ putStrLn ""
runIO $ putStrLn "1. Don't read the monad tutorials."
runIO $ putStrLn "2. No really, don't read the monad tutorials."
View Spam Poetry
Hi Sir/Madam,
So the guard of the Dover mail thought to himself, that Friday night in
Glad to hear that you're on the market for furniture, we specialize in FRP
Grating field for 10 years, with the strength of ERU&USA ANTIQUE FURNITURE,
with good quality and pretty competitive price. and were now making a general
pretence of being asleep.
god helps those who help themselves. I own, and I laugh at them whenever I
can. -- But these, I suppose, are precisely what you are without.
Also we have our own professional designers to meet any of your requriements.
View view-with
#!/usr/bin/env bash
if [ "$2" ]
then EXTENSION=".$2"
cat >"$TMPFILE"
if [ "$3" == "detach" ]
View Expose RM holds to Nasal
commit ca377c4ef297f0d6ed21f2a93a2bcbee3f2c12ca
Author: Tobias Dammers
Date: Thu Jun 21 18:29:49 2018 +0200
Expose holding point data in nasal
diff --git a/src/Scripting/NasalPositioned.cxx b/src/Scripting/NasalPositioned.cxx
index 22953bb2b..0d5fda303 100644
--- a/src/Scripting/NasalPositioned.cxx
+++ b/src/Scripting/NasalPositioned.cxx
View e26d8ff3b706951caa64af44a6e00e25485abd6e.diff
commit e26d8ff3b706951caa64af44a6e00e25485abd6e
Author: Tobias Dammers
Date: Sun Mar 18 20:10:23 2018 +0100
Fix: chat messages from MP list captured kbd forever
diff --git a/Nasal/multiplayer.nas b/Nasal/multiplayer.nas
index b58e35cc9..00ddd13c7 100644
--- a/Nasal/multiplayer.nas
+++ b/Nasal/multiplayer.nas
View c8c7fe024ee78a464a6b0cfd870439883371092c.diff
commit c8c7fe024ee78a464a6b0cfd870439883371092c
Author: Tobias Dammers
Date: Sun Mar 18 20:10:23 2018 +0100
Fix: chat messages from MP list captured kbd forever
diff --git a/Nasal/multiplayer.nas b/Nasal/multiplayer.nas
index b58e35cc9..3015f805a 100644
--- a/Nasal/multiplayer.nas
+++ b/Nasal/multiplayer.nas
View fizzbuzz.hs
import Data.Monoid
import qualified Data.Set as Set
import Data.Set (Set)
import Control.Monad (forM_)
-- | A rule is expressed as a function from a number to a set of words to say
-- instead of the number. If the set is empty, the convention is to say the
-- number itself.
type Rule a b = a -> Set b
View oop-why-not.markdown

This makes no sense to me. If the code design is bad there ought to be a concrete, unambiguous way to show this. If it's not possible to show this, how was there ever a problem in the first place?

It is possible to show in a concrete, unambiguous way, but unfortunately, the cases where the problems become clearly apparent tend to be large - way too large for a casual forum reply or a blog post.

I'll still take a stab at trying to explain what the problem is.

First, we have to define object-oriented programming, which isn't easy, because everyone seems to have their own ideas about the subject. They all do seem to agree that there should be a notion of objects, being things that have state (called "fields" or "properties") as well as associated behavior (called "methods"); further, objects form identities, that is, each object is identical to itself and only to itself, and has some sort of unique identifier (typically an ID, a memory address, or some sort of abstract handle or reference). Another fe

tdammers / def-varargs-class
Created Jul 1, 2015
def context -> different varargs seq impl
View def-varargs-class
user=> (defn foo [& args] (println (class args)))
user=> (foo 1 2 3)
user=> (def bar (foo 1 2 3))
tdammers / def-strict
Created Jul 1, 2015
def thwarting laziness?
View def-strict
user=> (defn foo [& fns] (fn [] (->> fns (map #(%)) (filter (comp not nil?)) (first))))
user=> ((foo (fn [] nil) (fn [] "OK") (fn [] (do (print "NONONO") "NO"))))
user=> (def blah (foo (fn [] nil) (fn [] "OK") (fn [] (do (print "NONONO") "NO"))))
user=> (blah)
You can’t perform that action at this time.