Technology wise, what are some alternative methods one could use to avoid repeating if/else if statements?

Technology wise, what are some alternative methods one could use to avoid repeating if/else if statements?

Attached: 1633000624528.png (830x1180, 688.08K)

Other urls found in this thread:

desuarchive.org/g/thread/88042584/
twitter.com/NSFWRedditImage

indexed/associative jump/function table

Use indirection and collapse all your cases into one indirection. You can do this in MAID-LISP:

start: ${coinFlip}

coinFlip: "heads" | "tails";
heads: "The maid flipped heads!";
tails: "The maid flipped tails!";

Attached: 1659991066112656.png (520x720, 197.21K)

Bah. I forgot to put a semicolon at the end of the start d-expression.

start: ${coinFlip};

coinFlip: "heads" | "tails";
heads: "The maid flipped heads!";
tails: "The maid flipped tails!";

Attached: 30d66b8513e27465bfba31bdcc5d63f7.png (1443x2048, 1.62M)

>The above program would generate one of the following strings at random:
>The maid loves lobster.
>It will never produce any of the following:
>The maid loves lobster.
most of the language on that page makes it look like it was written by a teenager in high school,

Pay attention to the placing of the bullet points. The strings are 2 lines long.

The string that will be generated in full is:
>The maid loves lobster.
>The maid loves squid.

The string that will never be generated is:
>The maid loves lobster.
>The maid hates squid.

It never gets generated because the function will either resolve to her loving or hating something, and never deviate after.

What do you think I could do to make the part with the generated strings more readable?

Attached: a027c1770f277a1a99e84e0fe0d52b50.jpg (1395x1621, 1.74M)

space between pairs and maybe L shape border

Switch/case

What is maid-lisp?

Mapping And Indirection Dialect of LISt Processor. It's a LISP I am working on. The maids in that page I posted came from my last thread. You can see other book pages here:

>desuarchive
desuarchive.org/g/thread/88042584/

I need more anime maids to finish my book though. Every page needs 3 or 4 maids.

>The future development of public domain computer science depends on contributions from Dra/g/ons like you.

Attached: d7763de4ae2ec6eb4b1d7ea75ddc54ef.jpg (1654x2339, 2.11M)

This is neat, good luck on finding maids

OOP, especially CLOS style. Indexing an array. Calculating a formula.

Thanks fren. Hopefully I can find one generous Dra/g/on who likes playing science on the internet. If I could get one Dra/g/on to donate like 500 maids that would probably be enough for me to finish the book without anymore maid begging.

It would at least be enough for me to make a lot of pages without worrying about my research going maidrupt.

Attached: sample_0d17bbb219a28f4958ceb0bdd84de2e3.jpg (850x1133, 311.16K)

>his language doesn't support pattern matching
Why are you wasting your time?

do you have a repo or something?
don't pull a Winds of Winter lol
Are the user who was looking for some old LISP manual?

>do you have a repo or something
I don't have a repo yet. I want to release the first draft of my book and the first draft of the interpreter code at the same time.

I want to bundle them together like when you used to get a book and it had a floppy disk in a packet in the back. Those were the most exciting kind of book.

Everything will be released to CC0 because playing science is only fun if you publish your work.

>Are the user who was looking for some old LISP manual?

There is a chance. A while ago I needed the first version of the LISP manual so I could learn maid expressions better to write a maid expression to dragon expression translator.

There was a nice MIT who found me the book in some archive or something. Translating S&M expressions to D-expressions will be part of the first release of the interpreter because of that nice MIT.

D-expressions don't really map 1-to-1 to LISP because I wasn't trying to make a LISP when I made them up. I was trying to make a better Dada Engine.

Consequently I have a lot of grammar dedicated to non-deterministic programming and the construction of recursive transition networks.

After the interpreter and book are released I will try to make a fork of the interpreter into a self-hosting RISC-V compiler so I can make a LISP machine with it. Probably I will get an FPGA and try to make a hardware acceleration when I play that game. I will write a book about that too if I can get people to donate the maids. So far making textbooks is cool. Playing science is fun.

Should I put student exercises in my book and make an answer key too?

Attached: sample_d5a4f1f7fac4fcc2498bce390cafdf40.jpg (850x1093, 625.56K)

You realize it's written by a teenager in high school, right?

What makes the language sound highschoolery? Is there an author I should emulate to sound more sciencey?

Attached: e829d277a43192cbb5f7bf2b26f8cdf8.png (2136x2959, 2.38M)

nakadashi

Wait a few years until you grow out of this phase.

A case, a cond, et al. It's not difficult, really.
If you're trying to avoid branching in general, it's much more difficult, you have to design some core functions in a way that makes them not require branching, like for example FORTH does with exceptions.