• 3 Posts
  • 17 Comments
Joined 1 year ago
cake
Cake day: July 6th, 2023

help-circle



  • Isn’t this (in-package ...) form just a namespace feature?

    It is not only a namespace feature; it is first class. You can use find-package to fetch a package object and pass it around and manipulate. It looks like this can be done to some extent in C# as well.

    For C# namespaces, exports carry over to different uses of the same namespace, but using statements go out of scope at the end of the current namespace use. That signals to me that imports are not related at all to namespaces. It seems that C++ acts similarly. From what I can tell Both C# and C++ allow for fully qualified names without any sort of import.

    I have to agree with you about Rust: they goofed it up my trying to make too many rules about which libraries and symbols can be used in which places.









  • Instead of storing intersect-p as a variable and keeping it until the end of the loop, you can return early as soon as you find the first intersection.

    Even though a hash table has better symtotic run time, you might find after benchmarking that the O(n^2) is faster for your use case. If you are set on using a hash table, you might consider setting the initial size to something a bit larger (relative to the input lists) to avoid having to dynamically grow the hash table.

    I think also the return value of the inner loop is never used...

    I personally like to keep my tests assertions top level so I can interactively run each one by itself.



    • Common Lisp. I basically only use SBCL. It has good introspection, restarts, and source analysis for debugging. I mainly write theoretical research code that doesn't depend on calling into the JVM or C++ code. I do try to keep my code portable, so I will check with other implementations from time to time.

    • I use GNU Emacs and Sly (though I am thinking of trying Lem). I don't use any structural editing outside of Emacs' built in electric-pair-mode, show-paren-mode, and expand-region (not built in). I don't even use rainbow delimiters anymore. I get all my Common Lisp dependencies from GNU Guix. It is very pleasant to use and is rolling release. In addition to Guix, I use cl-guix-utils, which adds live loading of dependencies quicklisp style.

    • I first learned Racket then Emacs Lisp (both in college). Emacs lisp was more pleasant due to its interactive and self documenting nature. I wanted to write real programs; Common Lisp looked and felt more like Emacs Lisp (but better). I started learning Common Lisp primarily with the "Lisp for the web" series. I was hooked. I learned more mainly through reading the hyperspec, studying other people source code and reading articles. I didn't read any of the famous books until I recently read "Practical Common Lisp". I already knew pretty much everything it had to offer. I wish I had read it sooner.

    GNU Guix: https://guix.gnu.org/

    cl-guix-utils: https://git.sr.ht/~charje/cl-guix-utils

    "Lisp for the web": https://adamtornhill.com/articles/lispweb.htm

    "Practical Common Lisp": https://gigamonkeys.com/book/