JavaScriptã®ä¸ã«ã¯ã³ã¼ãããã£ã¨ã·ã³ãã«ã§è¦ãããã§ãããã¿ã¼ã³ãããã®ã«ããã¾ã使ããã¦ããªããã®ãããã¾ããçããã Function.prototype.bind ã¯ãåãã§ããããé »ç¹ã«ä½¿ããã¦ãã var that = this ã var self = this ã®ä»£ããã«ãªãé¢æ°ã§ããããããã®ã以ä¸ã®ãããªä¾ã§ãã this.setup = function () { this.on('event', this.handleEvent.bind(this)); }; 第1å¼æ°ã bind ï¼æç¸ï¼ãããè¿ãããé¢æ°å 㧠this ã¨ãã¦åãã¾ãããã¾ãç¥ããã¦ãã¾ããã bind ã¯è¤æ°ã®ä»®å¼æ°ãåããã¨ãã§ãã bind ãããé¢æ°ãå¼ã³åºããã㨠bind ãããå¾ç¶ã®ãã¹ã¦ã®ä»®å¼æ°ã¯ããã®ä»®å¼æ°ãªã¹ãã®åã«ä»å ããã¾ãã ã¤ã¾ã以ä¸ã®ããã«ãé¢æ°ãé¨åé©ç¨ã
çµäºã®ãããã ããã° anopara 㯠2022å¹´12æ29æ¥ ããã«ééãã¾ããã å çã®æ¬¡åä½ã«ãæå¾ ãã ããã 次ã®ããã°ã¯å¤ååãURLã§åéãã¾ãã 詳ãããã¨ã決ã¾ã£ãããã¡ãã«æ¸ãã¾ã â https://twitter.com/anoparanominal åµä½é¢é£ã®æ´»åã¯ãã¡ã â https://y9ks.jp çµµã¨ã â https://twitter.com/yuri9000series
æè¿RubyããElixirã«æµãã¦ãä½ã§ãé¢æ°ã§æ¸ãããåä¾ã¿ãããªåä»ãªç æ°ã«ãªã£ã¦ãã¾ãã¾ããã Kotlin触ã£ã¦Næ¥ç®ç¨åº¦ãªã®ã§ä½ãæãã¤ããã³ã«æ¸ã足ãã¦ãããã¨æãã¾ã Recrucive ä¾ãã°ãããªã³ã¼ã defmodule String do def multiply(text, count) do multiply(text, count, "") end def multiply(_text, 0, temp) do temp end def multiply(text, count, temp) do multiply(text, count - 1, temp <> text) end end String.multiply("Hello", 10000) # => "HelloHelloHelloHelloHe........ fun main(args: A
learning Scalaz How many programming languages have been called Lisp in sheepâs clothing? Java brought in GC to familiar C++ like grammar. Although there have been other languages with GC, in 1996 it felt like a big deal because it promised to become a viable alternative to C++. Eventually, people got used to not having to manage memory by hand. JavaScript and Ruby both have been called Lisp in sh
scalaosusume.md Scala ãããããã¤ã³ããç´¹ä» ãããããã¤ã³ã æ®æ®µScalaã使ã£ã¦ãã¦ããã®æ©è½ã¯ä¾¿å©ãããã§ãã¦ããã¨æãã¦ããã¨ããããç´¹ä»ãã¾ãã æºå éçºç°å¢ plenvã¿ãããªãã¤ããã®? ã©ã¤ãã©ãªã¯ã©ããã£ã¦ãããã®? cpanfile/Gemfileã¿ãããªã®ããã®? èªåã§æ¸ããã³ã¼ãã®ãã«ãã¯ã©ãããã®? å ¨é¨sbtã§ã§ãã(ã¾ãã) ã¤ã³ã¹ãã¼ã« ããã°ã£ã¦JDKãã¤ã³ã¹ãã¼ã«ããã! ããã¦sbtãã¤ã³ã¹ãã¼ã«ããã! $ brew install sbt sbtã®ãã¥ã¼ããªã¢ã« Hello, World build.sbt name := "hello" scalaVersion := "2.10.3" Hello.scala object Hello { def main(args: Array[String]) = println(
ãã®è¨äºã¯ãRubyãæ¸ãã«ããã£ã¦ãããã«ãããã¯ãæ¸ããã«ãã¾ããããã追æ±ããã誰å¾ãªé£è¼ã§ããã ã ã£ã¦ããããã¯ã£ã¦æ±ããããï¼ä»®å¼æ°ã®|x|ã¨ããã¢ã¤ã Symbol#to_proc åºæ¬ä¸ã®åºæ¬ã instance method Symbol#to_proc 以ä¸ã®ãããªArrayããã£ã¦ã irb(main):003:0> arr = [:user, :entry, :article, :comment, :category] => [:user, :entry, :article, :comment, :category] åè¦ç´ ãto_sãããã£ããã irb(main):004:0> arr.map{|s| s.to_s} => ["user", "entry", "article", "comment", "category"] ã¨æ¸ããããã«ã irb(main)
This repository contains exercises, hints, and answers for the book Functional Programming in Scala. Along with the book itself, it's the closest you'll get to having your own private functional programming tutor without actually having one. There are two main branches in this repository: first-edition second-edition Be sure to select the branch which matches the edition of the book you are readin
å æ¥ãããã°æ¸ããä¸èª¿ãã¨æ¸ããããè¨èªã®ã¢ã¦ãããããä¸èª¿ãªã¨ãã¯ããã以å¤ã®ãã¨ãããã«éã...ãã¨ãã°é»ã ã¨ããã°ã©ã ãæ¸ããé³æ¥½ã«æµ¸ãã身ä½ãé ·ä½¿ããããªã©ã ãã¨ããããã§æææ¥ã天æ°ã¯æ´ããªãã£ããã®ã®ãç 究ã®ãã¼ã¿å¦çã«ä½¿ãRubyã¹ã¯ãªãããæ¸ãã¾ãã£ã¦é¬±æ¤ãæ´ããã¦ããã ã¨ããããã®ããã°ã©ã è³ã®ã¾ã¾å¤ã«ã¯VimM#4ã«è¡ããã¨ããæãããããã°å å®è ï¼äººã«ããSkypeä¼è°ãäºå®ããã¦ããï¼ã¤ã¾ãããã«ãããã³ã°ï¼ãã¨ãæãåºããèªåã®é¿åãã«åããæ¬å½ã«ãã¿ã¾ãããã§ãã£ã¦çµå±æ°åã¯æ´ããã åç½®ãï¼ãã ã®æ¥è¨ï¼çµããã æ¬é¡ã Rubyã®é åã§ãããããããæã«ãfor i in ...㨠array.each ã§ã ãããã§ãããã ãã©ããã¡ã£ã¨ã¹ãã¼ãã«ãããããªãã¨æã£ã¦èª¿ã¹ã¦ããããã使ããããããï¼ã¨æ°ãã¤ãããã¨ãããã¤ããããzipã¨injectã¨ev
rubyã§1å¼æ°é¢æ°ãmapã«æ¸¡ãå ´åã¯ããããªãããã§ã¡ã½ããã®ã·ã³ãã«ãProcãªãã¸ã§ã¯ãã¨ãã¦æ¸¡ãã¦é¢æ°ããã°ã©ãã³ã°ã£ã½ãæ¸ãæ¹ãã§ãããã ãã©ã irb > ('a'..'c').map &:upcase => ["A", "B", "C"] 2å¼æ°ã«ãªãã¨ã©ãæ¸ãã°ããããããã¨æã£ã¦ãã®ã ãã©ããã¼ãã§ã¯ãRubyèªãã§ããã9.3ç« Methodãªãã¸ã§ã¯ãã¨Procãªãã¸ã§ã¯ãã®ã¨ããã«ãããªæ¸ãæ¹ãè¼ã£ã¦ãã irb > (0..10).map &2.method(:*).to_proc => [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20] ããããç´æçãããªããã©ãæ°åã®2ã®ã¤ã³ã¹ã¿ã³ã¹ããä¹ç®ã¡ã½ãã*ã®Methodãªãã¸ã§ã¯ããåå¾ãã¦ãProcãªãã¸ã§ã¯ãã«å¤æãã¦æ¸¡ãã¦ããæ°åã®2ã¯Mehtodãªãã¸ã§ã¯ãã®ã¬ã·ã¼ãã¨ãã¦æç¸
å¤ãè¯ãå°å¦æ ¡ã®æ代ããã®è¡ã«ã¯å°æããããããã®ã ã£ãã éè¡ç㪠x ããå ç®ãããã®ã«çããã¾ã¾ã§ããäºã«ã ã©ãããããããããã°ã©ãã³ã°ãå§ããã¨ãããã«æ§ããªããªãã ããããããããã¯é大ãªäºæãããªãããããã°ã©ãã³ã°ã¨ã¯ç¾å®ã®ãã¸ãã¹è¡çºãªãã ããã æ°å¦çãªç´ç²ãã«ã¤ãã¦ããæ¢ããªãã¦å¿ è¦ç¡ã (ãã®è°è«ãªãã大å¦ã«ããçã£ãé«é¢ééã©ãã«ããã¦ããã°ãã)ãã¨æã£ã¦ããã ããã©ãããã ç¥ããªãã£ãã ãã§ãæã ãééã£ã¦ãã¦é«ã代åãæ¯æã£ã¦ããã®ã¯ æããã§ããã Wikipedia ã«ããã°ããé¢æ°åããã°ã©ãã³ã°(functional programming, FP)ã¨ã¯ã è¨ç®ãæ°å¦çãªé¢æ°ã®è©ä¾¡ã¨ã¿ãªãã ç¶æ ãå¯å¤ãã¼ã¿ãé¿ããããã°ã©ãã³ã°ãã©ãã¤ã ãã§ããã è¨ãæããã¨ãé¢æ°åããã°ã©ãã³ã°ã¯ã å¯ä½ç¨ãç¡ãå¤æ°ã®å¤ãå¤åãããªãã³ã¼ããæ¨å¥¨ããã
This document is compiled from RubyFunctionalProgramming by Arnau Sanchez (tokland) Japanese version is also available. Table of Contents Introduction The theory Functional programming in Ruby Don't update variables Blocks as higher order functions OOP and funcional programming Everything is an expression Recursion Lazy enumerators A practical example Conclusion Presentations Further reading Intro
æ¬ç¨¿ã§ã¯ãé¢æ°åããã°ã©ãã³ã°ã®ã³ã³ã»ãããå®ç¨çãªæ¹æ³ã§Rubyã®ã³ã¼ãã«çãè¾¼ãæ¹æ³ã«ã¤ãã¦ç´¹ä»ãã¾ããããã¯ãç§ããé¢æ°åããã°ã©ãã³ã°ã®ã¹ã¿ã¤ã«ãã¨å¼ãã§ãããã®ã§ãã ç§ãè¨ããå®ç¨çãã¨ã¯ãé¢æ°åããã°ã©ãã³ã°ã®ã¹ã¿ã¤ã«ãåãå ¥ããå¾ããªããã³ã¼ãã®è¦ãç®ãå°è±¡ã«Rubyã®ç¹å¾´ãæ®ã£ã¦ãããã¨ãæå³ãã¾ããRubyã¯ãHaskellã§ã¯ããã¾ããããHaskellã§ããã¹ãã§ãããã¾ãããèãæ¹ã¨ãã¦ã¯ããã®è¨èªã®æ§è³ªã å©ç¨ããã ã¨ãããã®ã§ãã£ã¦ãããã«åãããã¨ãããããã§ã¯ãªãã®ã§ããåºæ¥ä¸ãã£ãã³ã¼ãã¯ãRubyã¦ã¼ã¶ã«ã¨ã£ã¦ç°¡åã«ç解ã§ãããã®ã§ããã¹ãã§ãããã¾ãããã°ã使ãæ £ãã¦ãããã®ãããç°¡åã¨æãã¦ããã ããã¯ãã§ãã ã§ã¯ãå¯å¤æ§ãåé¿ããå©ç¹ãæ¹æ³ãæ¬ ç¹ãããã¦å¯å¤æ§ã®åé¿ãé©åã§ã¯ãªãã±ã¼ã¹ã«ã¤ãã¦è¦ã¦ããã¾ãããã ãªãå¯å¤æ§ãåé¿ããã¹ããªã®ã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}