• 3 Posts
  • 52 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.