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
| type | |
| RPizza = ref Pizza | |
| Pizza = object | |
| Backref: RPizza | |
| proc NoPizza(self: RPizza) = | |
| debugEcho "Pizza eaten by ghosts." | |
| proc main() = |
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
| # Something kind of like this; replicating wxWidgets style event mapping: | |
| ImplHandleEvent(MyEventHandler): | |
| On(CommandTriggeredEvent, self.OnCommand) | |
| On MorphClosedEvent, self.OnClosed | |
| On SomethingEvent do: | |
| debugEcho "Something else entirely..." |
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 works | |
| macro MakeIntoEvent* (etype: typedesc): stmt = | |
| let uid = NextEventTypeUID | |
| Inc(NextEventTypeUID) | |
| debugEcho "DUMP ID #", uid, ": ", repr(etype) | |
| result = quote do: | |
| proc GetEventTypeUid* ( | |
| self: typedesc[`etype`]): EventTypeUid {.inline.} = | |
| let x = `uid` | |
| return x |
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
| type | |
| CommandEvent = object | |
| Actions = enum | |
| AMeep, | |
| APacake | |
| MakeIntoEvent CommandEvent | |
| when isMainModule: |
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
| type | |
| FHandler = proc(x) {.closure.} | |
| Receivers = seq[FHandler] | |
| Beans = object | |
| floor: bool | |
| proc Emit(self: Receivers; x: int) = | |
| for e in items(self): | |
| e(x) |
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
| Red [] | |
| digit-nz: charset "123456789" | |
| digit: append copy digit-nz #"0" | |
| hex: append copy digit "abcdefABCDEF" | |
| sign: charset "+-" | |
| exponent-e: charset "eE" | |
| dquot: #"^"" | |
| exponent: [ exponent-e opt sign some digit ] |
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
| Red [] | |
| forth: context [ | |
| prog: [1 2 3 4 5 6 7 8 '+ '+ '* 150 '+ '* '+ '* '*] | |
| registers: ['eax 'ebx 'ecx 'edx] | |
| register-taint: [] ; registers we've touched in this set | |
| register-goop: [] ; registers we need to pop to use | |
| register-sets: 0 | |
| next-register: head registers |
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
| Red [] | |
| random/seed 1337 | |
| ; produces a series of chromosomes within [0, dna] of each supplied maximum | |
| make-dna-strand: func[dna | |
| /local dna-length result][ | |
| dna-length: length? dna | |
| result: make block! dna-length | |
| foreach chromosome dna [ |
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
| ralette-grammar: [ | |
| collect any [ | |
| ['decompose [ | |
| 'rgb keep ([ | |
| r: (color/1) / 255.0 | |
| g: (color/2) / 255.0 | |
| b: (color/3) / 255.0 | |
| ]) | | |
| 'hsl keep ([ | |
| h: (color/1) / 255.0 |
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
| From 7452eb01a2b5bf4143c0a478e109fee44df69c4f Mon Sep 17 00:00:00 2001 | |
| From: Joshua Cearley <[email protected]> | |
| Date: Sun, 14 Aug 2016 00:17:33 -0500 | |
| Subject: [PATCH] Triage to get things building. | |
| --- | |
| src/analyzer.cpp | 6 +++--- | |
| src/jack_client.cpp | 2 +- | |
| src/modules_dist.cpp | 4 ++-- | |
| src/modules_limit.cpp | 4 ++-- |