On Saturday, 19 November 2022 at 03:38:26 UTC, jwatson-CO-edu
wrote:
Thank you, something similar to what you suggested reduced the
atom size from 72 bytes to 40.
Oh, based on another forum post I added constructors in addition
to reducing the atom size 44%.
```d
struct Atom{
F_Type kin
On Thursday, 17 November 2022 at 22:49:37 UTC, H. S. Teoh wrote:
Just create a nested anonymous struct, like this:
struct Atom {
F_Type kind;
union { // anonymous union
struct {
Atom* car; /
On Thu, Nov 17, 2022 at 10:16:04PM +, jwatson-CO-edu via
Digitalmars-d-learn wrote:
> On Thursday, 17 November 2022 at 21:05:43 UTC, H. S. Teoh wrote:
[...]
> > struct Atom {
> > F_Type kind;
> > union { // anonymous union
> > Atom* car
On Thursday, 17 November 2022 at 21:19:56 UTC, Petar Kirov
[ZombineDev] wrote:
On Thursday, 17 November 2022 at 20:54:46 UTC, jwatson-CO-edu
wrote:
I have an implementation of the "[Little
Scheme](https://mitpress.mit.edu/9780262560993/the-little-schemer/)" educational programming language writt
On Thursday, 17 November 2022 at 21:05:43 UTC, H. S. Teoh wrote:
Question:
**Where do I begin my consolidation of space within `Atom`?
Do I use
unions or variants?**
In this case, since you're already keeping track of what type
of data is being stored in an Atom, use a union:
stru
On Thursday, 17 November 2022 at 20:54:46 UTC, jwatson-CO-edu
wrote:
I have an implementation of the "[Little
Scheme](https://mitpress.mit.edu/9780262560993/the-little-schemer/)" educational programming language written in D, [here](https://github.com/jwatson-CO-edu/SPARROW)".
It has many probl
On Thu, Nov 17, 2022 at 08:54:46PM +, jwatson-CO-edu via
Digitalmars-d-learn wrote:
[...]
> ```d
> enum F_Type{
> CONS, // Cons pair
> STRN, // String/Symbol
> NMBR, // Number
> EROR, // Error object
> BOOL, // Boolean value
> FUNC, // Function
> }
>
> struct Atom{
>
I have an implementation of the "[Little
Scheme](https://mitpress.mit.edu/9780262560993/the-little-schemer/)" educational programming language written in D, [here](https://github.com/jwatson-CO-edu/SPARROW)".
It has many problems, but the one I want to solve first is the
size of the "atoms" (un