- arsoitenarosit arsteoin
- arsitenaristn arsten
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
{-# LANGUAGE ExistentialQuantification #-} | |
-- interface Foo { | |
-- void doFoo(); | |
-- } | |
import Data.Char | |
-- A 'method' gets a this-ref, some args and a return type. |
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
trait Foo { | |
fn foo(); | |
} | |
impl Foo for &int { | |
fn foo() { | |
println!("&int") | |
} | |
} |
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
-module(horr). | |
-export([malloc/0, free/1, read/1, write/2, test/0]). | |
% You can use `malloc` to get a globally sharable, mutable cell of memory. | |
% A difference to C's `malloc` is that such a cell doesn't have a certain size (you can't overflow) | |
% Memory is initialised with the atom `null`. | |
malloc() -> | |
spawn(fun() -> mem(null) end). | |
% As processes are not garbage collected, you have to call `free` when you're done with your memory: |
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
-module(future). | |
-export([async/1, fulfill/2, block/1, test/0]). | |
async(Fun) -> | |
F = mk(), | |
spawn(fun() -> | |
fulfill(F, Fun()) end), | |
F. |
- yasnippets
- multiple-cursors
- ace-jump-mode
- keyboard macros (built in)
Run M-x list-packagesRET
to see a list of installable packages.
To see more packages, add the following lines at the beginning of your ~/.emacs
:
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
#include "stack.h" | |
#include <stdlib.h> | |
#include <assert.h> | |
typedef struct frame frame; | |
struct stack | |
{ | |
frame *top; | |
int size; |
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
class A {}; | |
// Proof of concept. | |
// | |
// A class that wraps a unique_ptr and creates a copy constructor that | |
// allows you to copy it without the explicit move constructor. | |
// The move constructor will be implied. This violates the expectation | |
// that copying a value is free of side effects and you should therefore | |
// probably not use this class. | |
template <class T> struct moving_unique_ptr { |
for emoji in $(gh api /emojis | jq 'keys | .[]' | tr '"' ":"); do echo "\`$emoji\` - $emoji"; done | gh gist create -w -f all-gh-emojis.md
:+1:
- 👍
:-1:
- 👎
:100:
- 💯
:1234:
- 🔢
:1st_place_medal:
- 🥇
:2nd_place_medal:
- 🥈