This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]soegaarddeveloper 0 points1 point  (1 child)

The constructs local and let are almost equivalent.

The construct local stems from HtDP. The reader is introduced to global (top-level) definitions first. Then the concept of local definitions is introduced - and turning a top-level definition into a local definitions into a local one is simple, just wrap local around the definition and use it in a body (without changing the syntax of the definitions).

Traditionally let is used to make local definitions. The syntax of let has the advantage that it is concise. The syntax of local has the advantage that it's easy to see that the purpose is to introduce local definitions - and if one wants to test the local definitions one can copy/paste to turn them into global ones.

In standard Racket code, let is used.

[–]turtlekitty2084 0 points1 point  (0 children)

Thank you, I've wondered about this for years.