Bucklescript "Top Level Declarations"?


#1

What does “Top Level Declaration” mean in bucklescript? The docs make a distinction between embedding and expression and making a top level declaration. I’m not following the distinction. Any elucidation available? Thank you.

Of note, editor reformation [%%raw "require('./index.scss')"]; to %raw "require('index.scss')"; So looks like its washing away the distinction anyway?


#2

That’s ppx%let in reason 3.1.0 notice no brackets


#3

Top-level basically means visually, no indentation (very poor way of explaining it, but you get the idea). a let foo = 1 that’s not nested inside anything else is top-level. a let foo = 1 that’s inside a function body isn’t at the top-level.