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

UFO演算子について

 UFO演算子について

RubyKaigi 2016 After Party (2016-09-10)

E3d8c68398580685ee7ef4ec2cc1cfc2?s=128

Hirofumi Wakasugi

September 11, 2016
Tweet

Transcript

  1. 6'0 ԋࢉࢠ ʹ͍ͭͯ (What's the Story) Spaceship Operator? Hirofumi Wakasugi

    (@5t111111)
  2. ϓϩάϥϚʔ Hirofumi Wakasugi (@5t111111)

  3. 4QBDFTIJQ0QFSBUPS  DMBTT4J[F.BUUFST JODMVEF$PNQBSBCMF EFGJOJUJBMJ[F TUS  !TUSTUS FOE 

    EFG PUIFS  TUSTJ[FPUIFSTUSTJ[F FOE FOE w #BTJDPQFSBUPSGPSDPNQBSJOHUIFSFDFJWFSBHBJOTUBOPUIFSPCKFDU w "MTPLOPXOBTl6'0PQFSBUPSz MFBTUJO+BQBO  w $MBTTFTNJYJOT$PNQBSBCMFNVTUJNQMFNFOU
  4. *NQMFNFOUBUJPOPG w1PTJUJWFOVNCFSJGTFMGJTHSFBUFSUIBOPUIFS w;FSPJGTFMGJTFRVBMUPPUIFS w/FHBUJWFOVNCFSJGTFMGJTMFTTUIBOPUIFS DMBTT'PP ǘ EFG PUIFS  SFUVSOJGTJ[FPUIFSTJ[F

    SFUVSOJGTJ[FPUIFSTJ[F SFUVSOJGTJ[FPUIFSTJ[F FOE FOE GPPGPPUSVFGBMTF *UTIPVMESFUVSO
  5. w :PVDBOXSJUFMJLFUIJTVTJOHJUTJNQMFNFOUBUJPO w -PPLTQSFUUZDPOWFOJFOU EPFTO`UJU "UJQGPSVTJOH DBTF GPPCBS  XIFO

    QVUTGPPJTFRVBMUPCBS XIFO QVUTGPPJTHSFBUFSUIBOCBS FMTF QVUTGPPJTMFTTUIBOCBS FOE
  6. w :PVDBOXSJUFMJLFUIJTVTJOHJUTJNQMFNFOUBUJPO w -PPLTQSFUUZDPOWFOJFOU EPFTO`UJU "UJQGPSVTJOH DBTF GPPCBS  XIFO

    QVUTGPPJTFRVBMUPCBS XIFO QVUTGPPJTHSFBUFSUIBOCBS FMTF QVUTGPPJTMFTTUIBOCBS FOE ʁʁ
 (SFBUFSJGQPTJUJWF  0SMFTTJGQPTUJWF  0SQPTJUJWFJGQPTJUJWF  85'
  7. 4P*BMXBZTEPUIFGPMMPXJOHTUFQTXIFO* XBOUUPVTFDPNQBSJTPOPQFSBUPSTXJUINZ DMBTTFT  *ODMVEFUIFNPEVMFJOBDMBTT  4UBSUXSJUJOHAEFG PUIFS FOEA 

    CFBOHVJTIFEUSZJOHUPSFNJOENFUPJGHSFBUFSMFTT NVTUSFUVSOQPTJUJWFOFHBUJWFOVNCFS  (PPHMJOHGPSBXIJMF  *UEPFTOPUXPSLʜ  6IPI*JODMVEF&OVNFSBCMFJOTUFBEPG$PNQBSBCMF
  8. 4P*UIJOL*NQMFNFOUBUJPOPG FYDFQUJPOBMMZMBDLTEFTDSJQUJWFQPXFS JO3VCZXPSME almost seems like magic numbers

  9. *USFNJOETNFPGTPNFUIJOHMJLF JOUDPNQBSF@JOU DPOTUWPJE B DPOTUWPJE C  \ SFUVSO JOU

    B JOU C ^ JOUNBJO  \ JOUEBUB<>\         ^ RTPSU EBUB  TJ[FPG JOU DPNQBSF@JOU  ^ w 0METDIPPM$JTIqBWPS w +BWB DPNQBSF5P /&5 $PNQBSF5P
  10. w *UXPVMECFFBTJFSUPLOPXUIFDPEFT`JOUFOTJPO *BNTVSFZPVDBOVTFJGʜFMTJGʜUIPVHI  *XJTI*DPVMEXSJUFMJLF DBTFGPPCBS XIFO&2 QVUTGPPJTFRVBMUPCBS XIFO(5 QVUTGPPJTHSFBUFSUIBOCBS

    FMTF QVUTGPPJTMFTTUIBOCBS FOE
  11. )BTLFMM DMBTT&RB0SEBXIFSF DPNQBSFBB0SEFSJOH EBUB0SEFSJOH-5]&2](5 ADPNQBSFA -5 0SE 0SEFSJOH DPNQBSFSFUVSOT0SEFSJOH 3VTU

    QVCFOVN0SEFSJOH\ -FTT  &RVBM  (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