Upgrade to Pro — share decks privately, control downloads, hide ads and more …

近況報告とかLiveScript(オマケ)とか

1644fba8a219c89987390ef4f23d06bf?s=47 Ayumu Sato
November 03, 2012

 近況報告とかLiveScript(オマケ)とか

大なごやJS Vol.4 発表資料(ぶん投げた内容で申し訳ない次第)

1644fba8a219c89987390ef4f23d06bf?s=128

Ayumu Sato

November 03, 2012
Tweet

Transcript

  1. ۙگใࠂͳͲ ؼলͨ͠ͷͰൃද͠·͢ EBJ/BHPZB+4WPM Saturday, November 3, 12

  2. !BIPNV ϚʔΫΞοϓΤϯδχΞ גࣜձࣾαΠόʔΤʔδΣϯτ ॴଐ͸௕͗ͯ͢Α͘Θ͔Βͳ͍ ৄ͘͠͸IUUQBIPNV Saturday, November 3, 12

  3. એ఻ͱ͍͏͔͓༠͍ #BDLCPOFKT"EWFOU$BMFOEBS IUUQXXXBEWFOUBSPSH DBMFOEBST ۭ͖·͘ΓͳͷͰμϨ͔ʂʂʂ Saturday, November 3, 12

  4. ࠓ೔͸ ౦ژʹస৬ˍҾͬӽͯ͠ϲ݄ ࣗ෼ͷৼΓฦΓ͔Ͷ͓ͯ࣌ؒΛഈआ ͶΉ͘ͳͬͨΒεϛϚηϯ Saturday, November 3, 12

  5. ਃ͠༁ OFX ܕ͸ͳ͍Ͱ͢ Ϟϩʹ8FCܥͰ͢ ੜʑ͘͠+BWB4DSJQUॻ͘Α ͔͠͠۩ମతͳ࣮૷࿩͸ͳ͍ʂ Saturday, November 3, 12

  6. Θͨ͘͠͝ͱ Saturday, November 3, 12

  7. +PCT ϓϩδΣΫτͷϑϩϯτ։ൃ ηϛφʔͷ४උ ࣾ಺ษڧձͷ։࠵ͱ͔෍ڭ׆ಈ ࣾ಺πʔϧͷࡐྉूΊ FUD Saturday, November 3, 12

  8. ͍·࡞ͬͯΔ΋ͷ ίϛϡχςΟαʔϏε γϯάϧϖʔδΞϓϦ #BDLCPOFͱ".%Ͱɺ.71ͳײ͡ αʔόαΠυͷ"1*ઃܭ͝ʹΐΓ 1IPOF(BQӽ͠8FC7JFX΋ Saturday, November 3, 12

  9. *OUFSFTU ϑϩϯτ༻ͷࣗಈԽ +4FSͷੜ࢈ํ๏ ڭҭ Ϟδϡϥʔͳ+BWB4DSJQU ґଘ؅ཧ 3FRVJSFKT 4OPDLFUT ςετ΍Β-JOU΍Β඼࣭؅ཧ Saturday,

    November 3, 12
  10. ϥΠϒϥϦͱ͔ πʔϧ޷͖͔ͩΒ঺հ Saturday, November 3, 12

  11. FH #BDLCPOFMPEBTI 3FRVJSFKT ;FQUP OFFENBLFCFPXO (SVOU MPDBMEFWFMPQNFOU +BTNJOF 4JOPO XJUI5FTUFN

    1IBOUPNKT Saturday, November 3, 12
  12. ;FQUP ϑΝΠϧαΠζ͕খ͍͞ͷ͸ਖ਼ٛʂ K2VFSZޓ׵ͳ%0.CBTFE-JC Ϗϧυඞཁ pMUFSͱ͔GBEF*Oͱ͔ BKBYͷ໭Γ͸%FGFSSFEͰͳ͍ Ұ෦஗͍ϝιου͸GPSLͯ͠վ଄ࡁ Saturday, November 3,

    12
  13. #BDLCPOFKT 7JFX͕௒ଠΔ ʅɹɾɹТɹɾɹA 3PVUFS7JFX.PEFMͷओै VOEFSTDPSFґଘ͸MPEBTIͰஔ׵ ந৅Խͨ͠ϥούΛ࡞੒༧ఆ IUUQTHJUIVCDPNNBSJPOFUUFKTCBDLCPOFNBSJPOFUUF IUUQTHJUIVCDPNDIBQMJOKTDIBQMJO Saturday, November

    3, 12
  14. 3FRVJSFKT ".% "TZODISPOPVT.PEVMF%FpOJUJPO  Ϟδϡʔϧ୯ҐͰॻ͘ͷʹΑΖ͍͠ ίʔϧελοΫ͕ͭΒ͍ 1SPEVDUJPO͸BMNPOEͰݻΊΔ SFRVJSFKT͔Β"KBYྨΛൈ͍ͨ΍ͭ ܰྔ Saturday,

    November 3, 12
  15. +BTNJOF ͳΜ͔ͩΜͩͰৗ༻ϙδγϣϯ KBTNJOFBTZOD KBTNJOFKRVFSZ %0..BUDIFS 4JOPO 4UVC .PDL ৭ʑ଍ͯ͠UFTUFNͰճͯ͠Δ Saturday,

    November 3, 12
  16. (SVOU +4Ͱಈ͘ϙʔλϒϧͳϏϧυπʔϧ ࣗಈϏϧυྨͷҰݩԽ͘Μ -PDBM4FSWFSͱ-JWF3FMPBEͱ͔ OPEFͰλεΫॻ͚Δ͔ΒϥΫ ࣾ಺Ͱ෍ڭதʢΘΓͱॱௐʣ Saturday, November 3, 12

  17. 1IBOUPNKT ओʹϔουϨεςετ༻ )"3 )551"SDIJWF औͬͯZTMPX ͰධՁɺͱ͔ଞͷ༻్΋ߟ͑த εΫϦʔϯΩϟϓνϟͱ͔΋ KTEPNͱ͔[PNCJFKT΋͋ΔͶ Saturday, November

    3, 12
  18. όϥϯεײ ͭͷ࣠ΛόϥϯεΑ͘ ͋ͨΒ͍ٕ͠ज़΍ख๏ΛֶͿ طଘͷރΕͨπʔϧΛ׆͔͢ ࣾ಺ͰγΣΞ͠ͳ͍ͱҙຯ͕ͳ͍ 3%ͷίετ͸ߴͭ͘͘ Saturday, November 3, 12

  19. ͜͜ͰऴΘΔͱ ͋Μ·ΓͳͷͰBMU+4 Saturday, November 3, 12

  20. ߦ͖ͷόεͰௐ΂ͨ ษڧձυϦϰϯͳௐ΂෺ Saturday, November 3, 12

  21. -JWF4DSJQU IUUQMJWFTDSJQUOFU Saturday, November 3, 12

  22. 0WFSWJFX $PGGFF]$PDP]-JWF4DSJQU "EETNBOZGFBUVSFTUPBTTJTUJO GVODUJPOBMTUZMFQSPHSBNNJOH )BTNBOZJNQSPWFNFOUTGPS PCKFDUPSJFOUFEBOEJNQFSBUJWF QSPHSBNNJOH Saturday, November 3,

    12
  23. 4UBOEBSE-JCSBSZ QSFMVEFMT IUUQHL[HJUIVCDPNQSFMVEFMT CBTFEJOQBSUPGGPGQSFMVEFIT BVUPNBUJDBMMZJNQPSU VTFEPSQSFMVEFPQUJPO QSFMVEFCSPXTFSNJOKT GPSCSPXTFS Saturday, November

    3, 12
  24. 5FYU&EJUPS4VQQPSU WJNMT WJN MJWFTDSJQUNPEF FNBDT -JWF4DSJQUUNCVOEMF FUD GPS5FYU.BUF $IPDPMBU BOE4VCMJNF5FYU

    8JMMCF4PVSDF.BQ  Saturday, November 3, 12
  25. (FUUJOH4UBSUFE Saturday, November 3, 12

  26. Πϯετʔϧ % npm install -g LiveScript Saturday, November 3, 12

  27. ର࿩ܕ % lsc --interactive --prelude livescript> [1 2 3] |>

    map (* 2) |> sum 10 Saturday, November 3, 12
  28. ίϯύΠϧ % lsc --prelude --output ./ file.ls # create ./file.js

    Saturday, November 3, 12
  29. 4ZOUBY'FBUVSF Saturday, November 3, 12

  30. ఆ਺ > const SHOULD = 'BE' 'BE' > SHOULD =

    'NOT' SyntaxError: redeclaration of constant "SHOULD" on line 1 Saturday, November 3, 12
  31. ෦෼ద༻ͱϝϯόΞΫηε > people = [{name: 'hoge'}, {name: 'fuga'}, {name: 'piyo'}]

    > people |> map (.name) |> filter (in ['hoge', 'fuga']) [ 'hoge', 'fuga' ] Saturday, November 3, 12
  32. είʔϓ > a = 123 123 > do -> a

    = 456 456 > a 123 Saturday, November 3, 12
  33. ԋࢉࢠ > unique [1, 1, 0] .length 2 > array

    = [1, 1, 0] > unique array or not empty array # in coffee # (unique array) or not (empty array) Saturday, November 3, 12
  34. ಺แදه &4 1UZIPO )BTLFMMϥΠΫ livescript> [a * b for a

    in [1, 2, 3] for b in [10, 20, 40]] [ 10, 20, 40, 20, 40, 80, 30, 60, 120 ] coffee> (a * b for a in [1, 2, 3] for b in [10, 20, 40]) [ [ 10, 20, 30 ], [ 20, 40, 60 ], [ 40, 80, 120 ] ] Saturday, November 3, 12
  35. ύλʔϯϚον # func(n, list) Ͱ list ͷઌ಄͔Β n ݸฦ͢ #

    list͕ۭͩͬͨΓn͕0ҎԼͰ͋Ε͹ [] Λฦ͢ take (n,[x,...xs]:list) -> | n <= 0 => [] | empty list => [] | otherwise => [x] +++ take n - 1,xs Saturday, November 3, 12
  36. ΧϦʔ > times = (x,y) --> x*y [Function] function (){

    var params = args ? args.concat() : []; return params.push.apply(params, arguments) < f.length && arguments.length ? curry$.call(this, f, params) : f.apply(this, params); } > times 2,3 6 > double = times 2 > double 5 10 Saturday, November 3, 12
  37. ฏ͍ͨBTZOD data <-! $.get 'ajaxtest' $ \.result .html data processed

    <-! $.get 'ajaxprocess', data $ \.result .append processed $.get('ajaxtest', function(data){ $('.result').html(data); $.get('ajaxprocess', data, function(processed){ $('.result').append(processed); }); }); Saturday, November 3, 12
  38. ༨ஊ Saturday, November 3, 12

  39. +BWB4DSJQUWJBXJLJQFEJB JavaScript͸ωοτεέʔϓίϛϡχέʔγϣϯζ ͷϒϨϯμϯɾΞΠΫʹΑͬͯ։ൃ͞ΕɺNetscape Navigator 2.0Ͱ࣮૷͞Εͨɻ։ൃ౰ॳ͸ LiveScriptͱݺ͹Ε͍͕ͯͨʢதུʣωοτεέʔ ϓͱαϯɾϚΠΫϩγεςϜζ͕ۀ຿ఏܞ͍ͯͨ͠ࣄ ΋͋ͬͨͨΊɺJavaScriptͱ͍͏໊લʹมߋ͞Εͨ Saturday, November

    3, 12
  40. "SUJDMFT 1BVM.JMMFSņŠ'VODUJPOBMQSPHSBNNJOHJO+BWB4DSJQU FDPTZTUFN IUUQQBVMNJMMSDPNQPTUTGVODUJPOBMQSPHSBNNJOHJOKBWBTDSJQUFDPTZTUFN 'VODUJPOBM1SPHSBNNJOHJO+BWB4DSJQUVTJOH-JWF4DSJQUBOE QSFMVEFMT IUUQHL[HJUIVCDPN-JWF4DSJQUCMPHGVODUJPOBMQSPHSBNNJOHJOKBWBTDSJQUVTJOHMJWFTDSJQUBOE QSFMVEFMTIUNM 3FBTPOTUP4XJUDIGSPN$PGGFF4DSJQUUP-JWF4DSJQU IUUQHL[HJUIVCDPN-JWF4DSJQUCMPHUFOSFBTPOTUPTXJUDIGSPNDPGGFFTDSJQUIUNM

    1PXFSGVMK2VFSZXJUI-JWF4DSJQU IUUQMJWFTDSJQUOFUCMPHQPXFSGVMKRVFSZXJUIMJWFTDSJQUIUNM Saturday, November 3, 12
  41. ͓͠·͍ Saturday, November 3, 12