apply()
,call()
の理解が足りない。
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
require 'formula' | |
class Gauche < Formula | |
url 'http://downloads.sourceforge.net/gauche/Gauche/Gauche-0.9.1.tgz' | |
homepage 'http://practical-scheme.net/gauche/' | |
md5 '6134e9c16aef2bc9fd3fa7e8fbebdd10' | |
def install | |
system "./configure", |
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
import qualified Control.Monad.State as S | |
import qualified Data.Map as M | |
import Control.Monad.Error () | |
data AST = Node [AST] | Leaf Value | |
instance Show AST where | |
show (Node xs) = "(" ++ unwords (map show xs) ++ ")" | |
show (Leaf v) = show v | |
data Value = IntVal Int | Define String AST |
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
# 私が考える安全なプログラムを書くために必要なこと | |
今も昔も「入力によって挙動が大幅に変わるAPI」が世の中には多数存在していて、プログラマが本来意図した挙動と異なる動作を引き起こしている。 | |
- ファイルを開こうとしたらコマンドを実行できてしまったり | |
- CSSセレクタを書いてるつもりがHTMLタグを生成してしまったり | |
- SELECT文を発行するつもりがDELETE文を発行できてしまったり | |
こういったときに | |
- 入力値検証をしないと危険になる |
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
import qualified VM as V | |
import qualified Text.Parsec as P | |
import Control.Applicative ((<|>), (<$>)) | |
import qualified Control.Monad.State as S | |
import qualified Data.Map as M | |
import Data.Maybe (fromJust) | |
data Intermediate = Comment String | |
| Inst V.Instruction | |
| Paramdef String |
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
function Class (bar) { | |
this.foo = bar; | |
} | |
Class.prototype.method = function () { | |
return this.foo; | |
}; | |
var instance = new Class('baz'), | |
func = instance.method; |
- その面白そうな話、私も参加していいよね?なぜなら私は無条件に受け入れられているからおじさん(闖入おじさん) #おじさんパターン
- 後出し難癖おじさん #おじさんパターン
- 困難は成長のチャンス!だから君たちに成長の機会をあげようおじさん (成長おじさん) #おじさんパターン
- あらゆる事案に一般論コメントおじさん #おじさんパターン
- 俺ってあらゆることに精通してるじゃん?だから力になるよおじさん (精通おじさん) #おじさんパターン
Original: "Callbacks are imperative, promises are functional: Node's biggest missed opportunity" by James Coglan
Translated by Yuta Okamoto (@okapies)
- 訳者は JavaScript や Node.js に関する専門知識がほとんどありません。識者のツッコミをお待ちしております。「◯◯が分からない」等も歓迎です。
- 元記事から構成を一部変更しています。また、関数型プログラミングに関する記述のうち、議論の骨子に絡まないものは省略しています。
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
"^ " | |
=~ ( | |
("(").("~"^"."^"^"^(""=="")."").("^" | |
^"="^(""=="").""^")").("^"^".").("=" | |
^"~"^(""=="")."").("("^(""=="^").""^ | |
"."^"^").("("^(""=="").""^"^"^")").( | |
(" ^( " | |
== " | |
") . | |
"" ^ |
OlderNewer