Closed getify closed 1 year ago
Great feedback and you are right! Welcome to submit a PR.
As for point 2., the "storing data section specifically refers to methods that store persistent data on-chain so I feel let
should not be mentioned there. Perhaps the language can be more clear.
@MarvinJanssen
As a compromise, could "Storing Data" section simply have a note that says something like "Unlike (let ..) which is temporary and localized to a function, these storage methods are persistent and stored on chain." Or something like that?
Sounds good to me!
As I was reading this book, I was really missing coverage of what seems like a very important core/101 kind of feature: the
let
function. Unless I missed it, I don't think it's ever covered formally until it just shows up in a code-example under one of the Flow-Control pages (more than halfway thru the book).In fact, TBH, since I'm not super well-versed in lisps, even referring to
let
as a function was unnatural to me, as it seems more like a keyword or core language feature. I kept thinking, "surely there's a way for me to create function-local variables, right!?! Right!?" As such, I didn't even think to look for it under "Functions" on the stacks-co language docs.I think it would make sense for this book to call this kind of thing out. Here's 3 places I think it makes sense:
In the "Clarity Basics" section, it could talk a bit more about s-expressions with function names (like
let
) work, and perhaps even a bit about why some of them require their arguments to be in sub( )
parens sets... likelet ( (..) (..) ) .. )
and all that. Being not super familiar with lisps, knowing when I need( .. )
is the biggest thing I'm tripping on while learning.In "Storing Data" section, a mention should be made that "function local variables" (with
(let .. )
) is a fourth place to store data (in addition to the 3 "Constants", "Variables", and "Maps")In "Functions" page, after "Function Body" sub-section, the
(let ..)
should be covered.I think it could be covered in all 3 of these places and that would improve the book. If agreed, I'd be happy to send in a PR for such.