Last active
November 30, 2016 18:16
-
-
Save joemfb/9fe1c76852783f74c0e8d5cb304c217c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: | |
:: super simple console app | |
:: | |
/? 314 | |
/+ sole | |
[. sole] | |
!: | |
|_ {bow/bowl $~} | |
:: | |
++ poke | |
|= * | |
=+ ost=p.,:(head (prey /sole bow)) | |
[[ost %diff %sole-effect %txt "foo"]~ +>.$] | |
:: | |
++ poke-sole-action | |
|= act/sole-action | |
:: ^- {(list move) _+>.$} | |
:_ +>.$ | |
:~ | |
|^ [ost.bow %diff %sole-effect resp] | |
++ resp | |
?- act | |
{$det *} [%det ler.act haw.act %set ~] | |
{$ret *} [%txt "hi there"] | |
{$clr *} [%mor ~] | |
== | |
-- | |
== | |
++ coup | |
|= {way/wire saw/(unit tang)} | |
~& %poke-resolved | |
~& way | |
~& ?~(saw ~ ((slog u.saw))) | |
[~ +>.$] | |
:: | |
++ peer | |
|= * | |
~& %peer-test | |
:: =+ ost=p.,:(head (prey /sole bow)) | |
=+ wel=[%txt "welcome to %test"] | |
=+ ins=[%txt "hit <ret> to print some foo"] | |
=+ pro=[%pro [& %test ":my-test-prompt:"]] | |
[[ost.bow %diff %sole-effect %mor ~[pro wel ins]]~ +>.$] | |
-- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Copy this to
%/app/test/hoon
, and then run|start %test
and|link %test
.Once linked, the welcome messages in
++peer
will print. You can ctrl-x to switch between:talk
,:dojo
, and:test
. Hitting return from the:test
prompt with print "hi there".You can also poke the app from
:dojo
::test ~
. The++poke
arm get's the bone of thesole
subscriber (:hood
), and sends asole-effect
to it.