1. ããªã¹ãã®è¦ç´ ãåå¾ãããé¢æ°ãä¾ã¨ãã¦ãã¯ã©ã¹ã®æ¡å¼µãèãã Lisp ã§ãªã¹ãã®å
é è¦ç´ ãå¾ãé¢æ°ã¯ car ãå
é 以å¤ã®æ®ãã®è¦ç´ ãåå¾ããã«ã¯ cdr ã (car '(1 2 3 4 5)) => 1 (cdr '(1 2 3 4 5)) => (2 3 4 5) ( cf. CAR and CDR â Wikipedia ) Haskell ã§ä¸è¨ã«ç¸å½ããé¢æ°ã¯ã head tail é¡ä¼¼ãã対ç
§çãªé¢æ°ã« init last ãããã main = do let xs = [1..5] print $ head xs -- 1 print $ tail xs -- [2,3,4,5] print $ init xs -- [1,2,3,4] print $ last xs -- 5 ãããã®é¢æ°åããä»ã®è¨èªã§ã使ããããã«ãæ¡å¼µã®æ¹æ³ãããããè¦ã¦ããã 2. Ru
{{#tags}}- {{label}}
{{/tags}}