TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Forward − a scheme front end framework inspired from elm

1 pointsby amiroucheabout 8 years ago

1 comment

amiroucheabout 8 years ago
In the most recent version create-app procedure looks like the following:<p><pre><code> (define (create-app+ container init view) (let ((state (init))) (letrec ((spawn (lambda (proc) (set-timeout (lambda () (proc state spawn)) 1000))) (make-action (lambda (action) (lambda args (let ((new (apply (action state spawn) args))) (set! state new) (render))))) (render (lambda () (set! container (patch container ((sxml-&gt;h* make-action) (view state))))))) render))) </code></pre> Basically it says that instead returning two values (first value being the new state and the second value being the intended side effect) it will only return the new state. But, it will take another argument with the state called spawn. The signature of actions is now state -&gt; spawn -&gt; dom-event -&gt; state. Spawn will schedule the lambda passed as argument. I will change spawn to look more like apply, so that it takes the arguments of the lambda as argument. This will make testing easier.