Y'all@theATL.social
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Programmer Humor@programming.dev · 7 months ago

When people encounter Lisp syntax for the first time

lemmy.ml

message-square
17
link
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
299

When people encounter Lisp syntax for the first time

lemmy.ml

cm0002@lemmy.world to Programmer Humor@programming.dev · 7 months ago
message-square
17
link
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
alert-triangle
You must log in or # to comment.
  • HyperfocusSurfer@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    18
    ·
    7 months ago

    WDYM “the 1st time”?

  • abbadon420@sh.itjust.works
    link
    fedilink
    arrow-up
    6
    ·
    7 months ago

    Where does that notation work?

    • felsiq@piefed.zip
      link
      fedilink
      English
      arrow-up
      42
      ·
      7 months ago

      Lisp uses it, with the fun extra part that operators are just normal functions - so instead of foo(bar) you get (foo bar), or for operators 1+1+2 becomes (+ 1 1 2). It’s a really fun language even just for being different than most, I def recommend playing around with it if you’re looking for something new.

      • BennyInc@feddit.org
        link
        fedilink
        arrow-up
        43
        ·
        7 months ago

        The fun part comes from using it without syntax highlighting, so you can regularly play „find the missing paranthesis“.

        • felsiq@piefed.zip
          link
          fedilink
          English
          arrow-up
          29
          ·
          7 months ago

          My lisp days were back in my “IDEs are bloat” phase so that’s the only way I ever interacted with it lmao

        • AnUnusualRelic@lemmy.world
          link
          fedilink
          arrow-up
          8
          ·
          7 months ago

          Editing lisp with ed is the best way to learn it.

      • Mika@piefed.ca
        link
        fedilink
        English
        arrow-up
        14
        arrow-down
        1
        ·
        7 months ago

        The most interesting part about Lisp is homoiconicity:

        (+ 1 1 2) is literally a list with symbol “+” and 3 numbers.

        Which allows to build the most powerful macro possible, manipulating code (with data as a tree-like structures) and changing it into whatever else at compile time.

        Now if only there was any good use for macros, this would be the best language 🙃

        • RecallMadness@lemmy.nz
          link
          fedilink
          arrow-up
          11
          ·
          7 months ago

          Threading is a great case for a macro.

          (-> x (* 2) (/ 3) (- 1))

          Is the same as (- (/ (* x 2) 3) 1)

          • Mika@piefed.ca
            link
            fedilink
            English
            arrow-up
            3
            arrow-down
            2
            ·
            7 months ago

            Sure it’s not like it has no uses, but it’s something languages have built-in as syntax sugar or operators, and you rarely need to built your own macro for anything.

            • Jerkface (any/all)@lemmy.ca
              link
              fedilink
              English
              arrow-up
              5
              arrow-down
              1
              ·
              edit-2
              2 months ago

              Removed by mod

              • Mika@piefed.ca
                link
                fedilink
                English
                arrow-up
                2
                ·
                7 months ago

                What does it have to do with lisp?

                • Jerkface (any/all)@lemmy.ca
                  link
                  fedilink
                  English
                  arrow-up
                  2
                  arrow-down
                  1
                  ·
                  edit-2
                  2 months ago

                  Removed by mod

    • Decq@lemmy.world
      link
      fedilink
      arrow-up
      7
      ·
      7 months ago

      In c style languages, Java, c++, rust, etc.

      • aubeynarf@lemmynsfw.com
        link
        fedilink
        arrow-up
        7
        ·
        7 months ago

        surely you mean Algol style languages?

        • Decq@lemmy.world
          link
          fedilink
          arrow-up
          6
          ·
          7 months ago

          I did, but I couldn’t remember it. so thanks!

    • bleistift2@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      1
      ·
      7 months ago

      deleted by creator

  • exu@feditown.com
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    3
    ·
    7 months ago

    Does that make Lisp a language with significant white space?

    • owsei@programming.dev
      link
      fedilink
      arrow-up
      15
      ·
      7 months ago

      yeah, the same way you can’t structuser {...}

      There has to be something to split the identifiers

  • BodilessGaze@sh.itjust.works
    link
    fedilink
    arrow-up
    3
    ·
    7 months ago

    What about the M-expression version (f[x])?

    • Frezik@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      5
      ·
      7 months ago

      AFAIK, the only language that ever implemented M-expressions was Logo.

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 109 users / day
  • 4.5K users / week
  • 8.07K users / month
  • 18.1K users / 6 months
  • 2 local subscribers
  • 31.1K subscribers
  • 2.18K Posts
  • 80.1K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • UI: 0.19.17
  • BE: 0.19.13-69-g026371327
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org