Skip to content

Instantly share code, notes, and snippets.

View ryuichiueda's full-sized avatar

Ryuichi Ueda ryuichiueda

View GitHub Profile
@ryuichiueda
ryuichiueda / string_condition.glue
Created January 18, 2015 14:49
A sample code for demonstration. Conditions of string is written in the where part.
import PATH
str hoge = echo 'aaaaaaaaaaaa'
where cond hoge : length < 10
echo hoge
@ryuichiueda
ryuichiueda / result_of_string_condition.glue
Created January 18, 2015 14:52
Result of $ ./glue EXAMPLE/string_condition.glue
Execution error at line 3, char 1
line3: str hoge = echo 'aaaaaaaaaaaa'
^
Over length
process_level 0
exit_status 3
pid 52433
import PATH
sleep 3 >> echo 'abc' >>= rev &a
echo 'b'
sleep 4
uedambp:GlueLang ueda$ ./glue hoge.glue
b
cba
import PATH
sleep 3 >> echo 'abc' >>= rev &a
echo 'a'
in.wait a
echo 'b'
uedambp:GlueLang ueda$ ./glue -v hoge.glue
+ pid 90998 fork a
+ pid 91000 fork
+ pid 91000 exec line 3 /bin/echo
+ pid 91001 fork
+ pid 91001 exec line 2 /bin/sleep
a
+ pid 91000 exit 0
+ pid 91001 exit 0
+ pid 91002 fork
import PATH
sleep 3 >> echo 'abc' >>= rev &a
sleep 2 >> echo 'def' >>= rev &b
in.wait a b
echo 'OK'
import PATH
#############################
# fizzbuzz.glue (for Mac) #
#############################
# make a file "nums"
file nums = seq 1 100
#gsed can be installed after "brew install coreutils"
import PATH
### ヒアドキュメントを実装する ###
### 代わりに改行できる変数を実装 ###
file awkcode = '{print NR,$1}'
### 変数は直接パイプに突っ込める###
'a
b
c' >>= awk -f awkcode
syntax on
let g:neocomplcache_enable_at_startup = 1
let g:neocomplcache_snippets_dir = $HOME.'/.vim/snippets'
syntax enable
" <C-k> にマッピング
imap <C-k> <Plug>(neocomplcache_snippets_expand)