James Brock

Results 280 comments of James Brock

Gonna call this thing `TreeBuilder` and use it like: ```python put = TreeBuilder() ```

Also going to return from inside the `with` like: ```python put = TreeBuilder() with put(View()) as root: put(Label()) put(Label()) ... return root

> I personally feel that all of these syntax changes make things somewhat more complex/confusing. One of the big strengths of Edifice is how easy is to build UIs and...

> I am not a fan of having to make the user decide when/if they should be using the `TreeBuilder`. Yeah. As @considerate has pointed out to me, the user...

Notes for docs: Python statements can contain expressions, but Python expressions cannot contain statements. Python branching statements are first-class - `if` - `for` - `match` Python branching expressions are awkward...

There is a Python docs article about functional programming https://docs.python.org/3/howto/functional.html

There is a React docs article about Conditional Rendering https://react.dev/learn/conditional-rendering Also Understanding Your UI as a Tree https://react.dev/learn/understanding-your-ui-as-a-tree

> @jamesdbrock JavaScript has conditional expressions though. You mean the ternary condition operator? I guess that is a better “conditional expression” than Python because it's right-associative and can be chained....

Reacton does almost exactly the same side-effecting-constructors trick that we do with **system 1.** https://github.com/widgetti/reacton/blob/16518bf6fe9ca018bf8576398deb9c8bc27d6dc3/reacton/core.py#L337-L342

One interesting thing about Reacton is that it requires the `@component` functions to return an `Element`. https://github.com/widgetti/reacton/blob/master/notebooks/todo-app.ipynb So the top-level `Element` is usually named by `with`..`as` and returned, and the...