you are viewing a single comment's thread
view the rest of the comments
[–] 11 points 8 months ago (4 children)

Go look at that Lisp kojumbo then tell me Rust is ugly.

(defmethod wake ((object magic-packet) address port)
  (let* ((payload (encode-payload object))
         (size (length payload))
         (socket (usocket:socket-connect nil nil :protocol :datagram :element-type '(unsigned-byte 8))))
    (setf (usocket:socket-option socket :broadcast) t)
    (usocket:socket-send socket payload size :host address :port port)
    (usocket:socket-close socket)))

Actually unreadable.

  • source
  • parent
  • hideshow 8 child comments
  • [–] 5 points 8 months ago (1 child)

    Entirely readable to someone who knows Common Lisp, and unreadable to someone who doesn't know any kind of Lisp. Mostly readable to someone who knows Emacs Lisp, Clojure, or Scheme.

    Being able to correctly guess what the syntax does without knowing the language is a function of similarity to familiar languages more often than it is a characteristic of the syntax itself.

  • source
  • parent
  • hideshow 2 child comments
  • [+] 3 points 8 months ago* (last edited 7 months ago) (1 child)
  • [–] 2 points 8 months ago (1 child)

    I imagine the tricky part for someone unfamiliar with Lisp would be that there's no syntactic clue that a particular thing is a macro or special form that's going to treat its arguments differently from a function call. Someone who knows Scheme may have never seen anything like CLOS, but would see from context that defmethod must not be a function.

  • source
  • parent
  • hideshow 2 child comments
  • [+] 2 points 8 months ago* (last edited 7 months ago) (1 child)
  • [–] 1 point 8 months ago (1 child)

    You don't even need to define a class to define methods. I'm sure that's surprising to people coming from today's popular language, but the original comment was about syntax.

    Whether Lisp syntax is ugly is a matter of taste, but it's objectively not unreadable.

  • source
  • parent
  • hideshow 2 child comments