[Felix-language] gotchas again

2014-01-19 Thread john skaller
Shayne .. when you're playing with fthread be aware of the well known "gotcha". When you do something like var x = 1; spawn_fthread { .. println$ x; }; x = 2; the "x" in the fthread is just a reference to a variable. There's no knowing what the value will be, it may be 1

[Felix-language] docs: todo

2014-01-19 Thread john skaller
Felix has a glossary on the website, but I can't hyperlink to it. That would be useful. More, a "wiki" thing would be useful, where some "term" would get a fuller description than the glossary. We can use flx_iscr to extract articles, and we can write some Felix script to generate the glossary (s

Re: [Felix-language] TCP/IP in Felix

2014-01-19 Thread john skaller
Just one more note. Although sockets are bidirectional (and thread safe) Felix cannot handle two requests at once. It can only do half-duplex communications. When a request is made the fthread making it is blocked. It is vital no other fthread makes a request on that socket until it the first one

[Felix-language] TCP/IP in Felix

2014-01-19 Thread john skaller
Just some notes! See src/tools/dflx_web.flx! Step 1: Set up server listening socket on PORT. var PORT=1234;// port to listen on val qlen = 10; // length of queue var listener: Socket::socket_t; // server socket Socket::mk_listener(&listener