Closed weswigham closed 10 years ago
Some of the incorrect syntax in here is just from me not updating the docs properly. >.> I'll fix those first.
Any method with side-effects should have a !
as part of the name
Any method that evaluates to a Bool
should have a ?
If a cond
only has one case and a default case, if <block> else <block>
is better.
I'm not sure how we should go about global constants. Maybe the Rust const <id> = <expr>
would work?
Wouldn't a let
in the global scope be a global?
If we were to allow let at a top-level, all of those statements would actually be let!
s as we're modifying current scope, not creating a new one.
Is this based on the Haskell IRC bot? Just wondering for reference.
This is totally based on the haskell IRC bot. (Albeit, with shortcuts made based on personal preference)
Alright, let's do the top-level let
s as separate let!
s.
if
s and else
s don't need the stabby arrow, as they are eagerly evaluating the block below them on that condition.
Neither do !quit
and !id
. The lambda syntax is sufficient there |thing| { puts thing }
, since that evalutates directly to a Function
instance.
Since these are all really trivial, I'm going to pull, close, edit, and then squash.
I feel like a more complete/cohesive example or Brick's syntax would be nice. A simple IRC bot like this one would go a long way towards such an example. I've tried to capture what I have learned about the syntax thus far, but there will invariably be some errors in what I've assumed, it would be awesome if you could correct me and we could see how something like this would work.