So you think Common Lisp is better than Python

Then tell me how do you split a string by delimiter in CL? (Without using libraries, don't be a pajeet)
That's what I thought

CRIME Shirt $21.68

Yakub: World's Greatest Dad Shirt $21.68

CRIME Shirt $21.68

  1. 2 years ago
    Anonymous

    Don't abuse Satania-chan like that.

  2. 2 years ago
    bruce3434

    >cniles/seplets right now

    • 2 years ago
      Anonymous

      C/C++ string handling is fairly easy. It’s the built-in functions that are AIDS.

  3. 2 years ago
    Anonymous

    How do you do it in python without importing anything?

    • 2 years ago
      Anonymous

      You can use the string method "split".
      Yep, method. Everything in python is an object, including a simple string containing the word "Black person".

      I will never forget the day I stop hating OOP. Learn python was by far the best decision I made in my career.

    • 2 years ago
      Anonymous

      'wiener-sucker'.split('-')

  4. 2 years ago
    Anonymous

    can python do this
    echo "56,http://link,data with,with a comma" | perl -nE 'my$l=join "t", split /(?<!\),/;print+$l=~s/\,/,/gr'
    56 http://link data with,with a comma

  5. 2 years ago
    Anonymous

    i kneel
    we don't even have while loops how could we ever compete

    • 2 years ago
      Anonymous

      we do though

    • 2 years ago
      Anonymous

      ???
      (loop while condition do stuff)

  6. 2 years ago
    Anonymous

    I can't tell if this is a troll post or if you actually think CL can't manipulate strings? Or is it because unlike in Python it requires a bit of brainpower to use substr and position functions?

  7. 2 years ago
    Anonymous

    oh wow he can split a string without importing a library because that function just happened to be included! what a gay kek
    now try doing literally anything nontrivial without importing libraries and suddenly the entire appeal of python crumbles.

  8. 2 years ago
    Anonymous

    So you think Python is better than Common Lisp?
    Then tell me how do you get a fixed-width integer? (Without using libraries, don't be a pajeet)
    That's what I thought

  9. 2 years ago
    Anonymous

    (ql:quickload :cl-ppcre)

    And just use regex. If you want a solution that doesn't involve external libs, let's use csv as an example:

    * (defparameter *csv-readtable* (copy-readtable))
    (set-syntax-from-char #, #Space *csv-readtable*)
    (defun read-csv-line (string) (let ((*readtable* *csv-readtable*))
    (with-input-from-string (stream string) (loop for object = (read stream nil nil) while object collect object*~~)

    • 2 years ago
      Anonymous

      >cl-ppcre
      why not uiop:split-sting ?

      • 2 years ago
        Anonymous

        You could do that too. I was also trying to remember if Alexandria has a string-splitting util but didn't feel like looking it up.

  10. 2 years ago
    Anonymous

    Here's the one I just did
    (defmacro while (expr &rest block)
    `(tagbody
    loop
    (if ,expr
    (progn ,@block (go loop*~~))

    (defun split (sep str)
    (let* ((start 0)
    (end 0)
    (substrings (list nil))
    (ptr substrings)
    (len (length str*~~
    (while (< end len)
    (while (and (< end len)
    (not (char= sep (aref str end*~~)
    (setq end (1+ end*~~
    (setf (cdr ptr) (list (subseq str start end*~~
    (setq ptr (cdr ptr))
    (setq start (1+ end))
    (setq end (1+ end*~~
    (setq substrings (cdr substrings))
    substrings))

    (princ (split #space "one two three"))
    (terpri)

    Can someone rate this? honestly

    • 2 years ago
      Anonymous

      just realised that we can return directly (cdr substrings)

  11. 2 years ago
    Anonymous

    It is better.
    - far more efficient
    - can actually distribute binaries to customers
    - has a standard
    - has multiple up to date implementations
    - is academically interesting
    - has better books

Your email address will not be published. Required fields are marked *