Changes of Programming/Onyx/2008/02/26/udpmsg between 2008/02/26 12:18:10 JST and 2008/02/26 12:28:43 JST
- + added lines
- - deleted lines
Return to the edit history
[http://read-eval-print.blogspot.com/ @quek]さんがなにやらスタック型言語を作っていらっしゃるので、
ひさびさにスタック型脳を活性化させました。まる。
udp経由でipmsgにメッセージを送りつけるコード。
{{{
$ipmsg_version 16@0001 def
$ipmsg_default_port 16@0979 def
$ipmsg_sendmsg 16@020 def
$format_msg {
- $extra exch def $cmd exch def $host exch def $user exch def $num exch def
- ipmsg_version <$d 10> outputs `:' num <$d 10> outputs `:' user `:' host `:' cmd <$d 10> outputs `:' extra
- 10 { cat } repeat
+ $extra exch def $cmd exch def $host exch def $user exch def $num exch def
+ ipmsg_version <$d 10> outputs `:' num <$d 10> outputs `:' user `:' host `:' cmd <$d 10> outputs `:' extra
+ 10 { cat } repeat
} def
$udpmsg {
- $msg exch def $host exch def
- $AF_INET $SOCK_DGRAM $udp socket
- dup host ipmsg_default_port connect
- dup msg send
+ $msg exch def $host exch def
+ $AF_INET $SOCK_DGRAM $udp socket
+ dup host ipmsg_default_port connect
+ dup msg send
} def
realtime srand
`targethost' rand `myname' `myhost' ipmsg_sendmsg `hello,world.' format_msg udpmsg
}}}
って[http://www.canonware.com/onyx/ Onyx]って知らない人が多いかも知れないけど、
threadやOOPが扱えるForth型言語。
{{{
。
〉
○ノ イヤッホォォ!
<ヽ|
i!i/,|i!ii ガタン
}}}
これは流行らない。