This month, I added CSG (Constructive Solid Geometry) operators to the ray-tracer that I mentioned in the previous post. I added intersections, complements, and unions.
You can find the source code in my weekend-raytracer github repo.
This month, I added CSG (Constructive Solid Geometry) operators to the ray-tracer that I mentioned in the previous post. I added intersections, complements, and unions.
You can find the source code in my weekend-raytracer github repo.
I am releasing a new version of the USerial library. New in this version:
I am releasing a new version of my USerial library. This version cleans up many messes from earlier releases. Unfortunately, in that process, it breaks compatibility with earlier releases.
Getting the USerial library:
The differences between this version and earlier versions of this library include:
:buffer
parameter in favor of using the *buffer*
special variable:buffer
parametermake-list-serializer
macroBy using ContextL layered functions, one has the ability to define a serializer and/or unserializer in a particular ContextL layer. This can be used to create new versions of the serializer without losing the ability to use the older version when required.
In the process, I have created macros to assist in creating completely custom serializers. This both streamlines their definition and should allow any future modifications to the USerial library to fly under the radar. Code that before looked like this:
Should now look like this:
And, when you find you need to add a new version of your :foo
serializer but you don’t want to lose the old one, you can add:
Without the :buffer
parameter everywhere, code that used to look like this:
Should now look like this:
There are now :int
and :uint
serializers that encode arbitrarily large integers and unsigned integers, respectively. There is also a serializer that copies a sequence of bytes as is without any prefix or suffix. To unserialize, you either have to provide a buffer of the appropriate length with the :output
parameter or provide appropriate :start
and :end
keywords.
And, if you have a serialize/unserialize pair for type :foo
you can use the make-list-serializer
macro to create a serialize/unserialize pair for a list of items that can be serialized with the :foo
serializer.
At the USerial home page, you can find more complete documentation.
I am releasing a new version of my USerial library. This version cleans up many messes from earlier releases. Unfortunately, in that process, it breaks compatibility with earlier releases.
Getting the USerial library:
The differences between this version and earlier versions of this library include:
:buffer
parameter in favor of using the *buffer*
special variable:buffer
parametermake-list-serializer
macroBy using ContextL layered functions, one has the ability to define a serializer and/or unserializer in a particular ContextL layer. This can be used to create new versions of the serializer without losing the ability to use the older version when required.
In the process, I have created macros to assist in creating completely custom serializers. This both streamlines their definition and should allow any future modifications to the USerial library to fly under the radar. Code that before looked like this:
Should now look like this:
And, when you find you need to add a new version of your :foo
serializer but you don’t want to lose the old one, you can add:
Without the :buffer
parameter everywhere, code that used to look like this:
Should now look like this:
There are now :int
and :uint
serializers that encode arbitrarily large integers and unsigned integers, respectively. There is also a serializer that copies a sequence of bytes as is without any prefix or suffix. To unserialize, you either have to provide a buffer of the appropriate length with the :output
parameter or provide appropriate :start
and :end
keywords.
And, if you have a serialize/unserialize pair for type :foo
you can use the make-list-serializer
macro to create a serialize/unserialize pair for a list of items that can be serialized with the :foo
serializer.
At the USerial home page, you can find more complete documentation.
Edit: After re-reading some of the ContextL papers, I believe that I am actually just going to use ContextL as it’s a much more flexible superset of this library. I will probably still keep this library published as an example of a non-trivial, but glarkable, method combination.
I am releasing a new library that allows one to dispatch generic methods based on the value of a global parameter.
There are situations where one might like to dispatch a method on some information other than the required parameters of the method. For many situations, it is sufficient to switch between those methods based on some external parameter. The method-versions library allows one to do just that.
In this example, we do a silly form of internationalization. To that end, we will use English as the default language and define some other languages.
We will prepare a language parameter and a welcome method that is versioned on the language.
And, we define welcome methods for the various languages (accidentally forgetting spanish
).
Then, we will try each of the languages in turn.