Hi r/scheme, my little brother (11) is interested in programming. Since he doesn’t know what he wants to make yet, I feel like scheme could be a good first language to learn the basics, paired with “The Little Schemer”, a book I worked through when I was younger that I feel like he’d like and would teach him some solid CS foundations. Any input on this?

  • raevnos@alien.topB
    link
    fedilink
    English
    arrow-up
    1
    ·
    11 months ago

    (define (atom? x) (not (pair? x))) is the same as Common Lisp atom, but I’ve seen some Scheme texts that use versions that treat '() as not an atom. Can be confusing if you have one definition in mind and look at something that uses the other.

    • jason-reddit-public@alien.topB
      link
      fedilink
      English
      arrow-up
      1
      ·
      11 months ago

      If (not (eq? '() #f)) then it may make sense to treat '() as non-atomic. “atomic?” would then be a cheap version of “list?”.