cbiffle / ruckus

Procedural CAD for Weirdos
Other
50 stars 6 forks source link

Shape creation via side effect does not allow for named objects #5

Open thomastjeffery opened 4 years ago

thomastjeffery commented 4 years ago

Take for example this code:

#lang ruckus

(let ([ball (sphere 200)]
      [box (cube 300)])
  (difference box ball))

This crashes, since difference is given '().

Without the call to difference, we would have this confusing program:

#lang ruckus

(let ([ball (sphere 200)]
      [box (cube 300)])
  ball)

Instead of showing us only the sphere, this program would show us both the ball and sphere, and happily ignore the fact that the let form evaluates to '().

 

This isn't simply confusing behavior: it's leaves no method for naming objects.

It's a bit like a strawman version of racket where all strings evaluated to '(), while having the side effect of printing to the console. Sure, "Hello, world!" would be simpler, but at great cost.