Skip to content

Instantly share code, notes, and snippets.

View stepancheg's full-sized avatar

Stepan Koltsov stepancheg

View GitHub Profile
// "library" function to declare a record
[Base]
recordExtend(static Base, ..fields) = ..RecordFields(Base), ..fields;
// "library" function to declare hierarchy
// should be overloaded for each subtype, type pair
[A, B]
Extends?(static A, static B) = false;
diff --git a/lib-clay/parsing/combinators/generic/generic.clay b/lib-clay/parsing/combinators/generic/generic.clay
index 24cac60..84a7c6d 100644
--- a/lib-clay/parsing/combinators/generic/generic.clay
+++ b/lib-clay/parsing/combinators/generic/generic.clay
@@ -414,6 +414,6 @@ optSeparatedListStrict(#TokenInput, forward _separator:Separator, forward _eleme
alias T = ParseResult(TokenInput, Element);
return modify(
x => maybe(move(x), y => move(y), () => Vector[T]()),
- optional(separatedListStrict(_separator, _element)),
+ optional(TokenInput, separatedListStrict(TokenInput, _separator, _element)),
#include <stdio.h>
struct zzz {
static int bar(long p) {
return 4;
}
static int foo() {
return bar(0);
}
#include <stdio.h>
int bar(long p) {
return 4;
}
int foo() {
return bar(0);
}
define subtuple;
[n1]
overload subtuple(t, static n1, ..ns) {
return Tuple(..unpack(subtuple(t, static n1)), ..unpack(subtuple(t, ..ns)));
}
[n]
overload subtuple(t, static n) = [staticIndex(t, static n)];
@stepancheg
stepancheg / gist:2878539
Created June 5, 2012 22:28
Устав общества взаимного страхования от штрафов на митинге 12 июня
= Устав общества взаимного страхования от штрафов на митинге 12
июня
(предварительная версия)
== Неформальное введение
Если специально не провоцировать, вероятность получить штраф мала.
Однако штраф очень велик. Участники общества берут на себя обязательство
помочь расплатиться со штрафами другим таким же участникам общества.
#!/bin/sh -ex
ivy_version="2.3.0-rc1"
classes_file="lib/ivy/ivy-$ivy_version.jar"
sources_file="lib/ivy/ivy-$ivy_version-sources.jar"
if [ ! -e $classes_file ]; then
mkdir -p lib/ivy
curl --silent --output $classes_file.tmp \
[stepancheg@negev:~/jb/kotlin]% git format-patch ...
*** glibc detected *** git: double free or corruption (!prev): 0x00000000007627e0 ***
======= Backtrace: =========
/lib/libc.so.6(+0x775b6)[0x7fe0b6c865b6]
/lib/libc.so.6(cfree+0x73)[0x7fe0b6c8ce83]
/lib/libc.so.6(fclose+0x14d)[0x7fe0b6c76abd]
git[0x47b51c]
git[0x486fc9]
git[0x4870db]
git[0x433465]
[stepancheg@negev:~/jb/kotlin]% git pull --rebase
usage: git merge-base [-a|--all] <commit> <commit>...
-a, --all outputs all common ancestors
usage: git merge-base [-a|--all] <commit> <commit>...
-a, --all outputs all common ancestors
usage: git merge-base [-a|--all] <commit> <commit>...
#include <iostream>
#include <tr1/functional>
using namespace std;
using namespace std::tr1;
using namespace std::tr1::placeholders;
void foo(int x) {
cout << "foo " << x << endl;