Common Lisp | Scheme | Haskell | OCaml | F# | SML | Ruby | Smalltalk | C# |
---|---|---|---|---|---|---|---|---|
mapc | for-each | mapM_ | iter | iter | app | each | do: | ForEach (List<T>のみ) |
mapcar | map | map | map | map | map | map, collect | collect: | Select |
find-if | find | find | find | find | find | find, detect | detect: | First |
remove-if-not | filter | filter | filter, find_all | filter | filter | find_all, select | select | Where |
reduce | fold, fold-left | foldl | fold_left | fold | foldl | inject | inject:into: | Aggregate |
reduce :from-end t | fold-right | foldBack | foldr | fold_right | foldr | - | - | - |
some | any, exists | any | exists | exists | exists | any? | anySatisfy: | Any |
every | every, for-all | all | for_all | forall | all | all? | allSatisfy: | All |
This file contains 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
#!/bin/sh | |
WORKING_BRANCH=`git branch -l | grep "*" | cut -d " " -f 2` | |
IFS_ORIG=$IFS | |
IFS=# | |
arr=($WORKING_BRANCH) | |
IFS=$IFS_ORIG | |
size=${#arr[@]} |
This file contains 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
#!/bin/sh | |
PREFIX="from now" | |
MESSAGE="[${PREFIX}] `date +\"%Y/%m/%d %T\"`" | |
MAIN_BRANCH=${1:-master} # デフォルトは 'master'、第1引数で上書き可能 | |
shift # 引数リストからメインブランチ名を除外 | |
get_amend() { | |
if [ -z `git log --pretty=oneline --no-color -1 | cut -d " " -f 2- | grep "^\[${PREFIX}]"` ] |
- CommonLisp:
- hash-table
- Scheme:
- hash-table (SRFI-69), hashtable (R6RS Scheme)
- Haskell:
- Map
- OCaml:
- Hashtbl, Map
- SML:
- hash_table (sml-nj-lib)
This file contains 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
package Mojolicious::Plugin::Charset; | |
use Mojo::Base 'Mojolicious::Plugin'; | |
sub register { | |
my ($self, $app, $conf) = @_; | |
return unless my $c = $conf->{charset}; | |
return unless my $e = $conf->{encoding}; | |
$app->types->type(html => "text/html;charset=$c"); |