Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Eval considered

Name: Anonymous 2015-02-01 10:13

Using eval is almost always a bad idea. It's a crutch for bad designs, it opens giant security holes in your code, and in practice it's almost never needed to get actual stuff done.

Name: Anonymous 2015-02-01 16:42

I take it you've only ever written toy, single-threaded programs.
Plus, if you're threading program state through functions as more than one argument, you're doing it entirely wrong.
type state = { i_am_here: int; enable_frobnicator: bool; _ }
val do_the_thing : state -> state
val go_over_there : int -> state -> state

Oh look, a nice, single place to put your global state. No ``protection'' required and it's just as simple as a smaller functional program.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List