HNHacker News
TopNewBestAskShowJobs

fatcow

57 karma · joined May 25, 2019

amateur guiler
submissionscomments
fatcow··on Pattern matching accepted for Python
Your snippet would be condensed into 1 indentation block with pattern matching. In scheme it'd be even more explicit that we're deconstructing command, therefore much much easier to follow logic. No need to worry about cmd, args, etc.

  (match command
    (("quit")    (display "Goodbye!"))
    (("look")    (describe current-room))
    (("get" obj) (character-get obj current-room))
    (("go" dir)  (set! current-room (room-neighbour dir)))
    (_           (display "Invalid command")))
fatcow··on 1937 film explains how a car differential works
lol

Did you say youts?

fatcow··on Lightening run-time code generation
Sorry for delay - will raise hand on #guile when online next
fatcow··on Lightening run-time code generation
Hi! I'm struggling to lean peg in guile - care to share csv-parsing code please?
← PreviousPage 2 of 2