Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Are you sure you can do that? Because it is trivial to paraphrase code and text.


Sure. I’ve done it for Bel.

  (def no (x)
    (id x nil))

  (def atom (x)
    (no (id (type x) ‘pair)))

  (def some (x f)
    (if (no x) nil
        (f (car x)) x
        (some (cdr x))))

  (def all (x)
    (if (no x) t
        (f (car x)) (all (cdr x))
        nil)))
I don’t even have to pull up bel.bel to know that those are almost perfect replicas. I typed it on my iPad.

EDIT: as far as I can tell, the only diff is that all comes before some. https://sep.yimg.com/ty/cdn/paulgraham/bel.bel?t=1595850613&

I could have kept going through most of the implementation.


I'd wager that most folks would consider the code for some basic list operations to be a little different from outputting a complete specific implementation of a fast square root function with its exact constants, including the comments.


Why? They’re both basic functions. I’d argue that if pg had left comments and constants, I’d have replicated those too.

Perhaps my example isn’t as impressive as the model’s capability, but operationally it’s the same.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: