Thank you all for the explanations.
I find the trade-off of a semantic change for constent behavior with
threads to be well worth it!
I look forward to trying out the mulit-threading support when I find the
time ...
On Sun, Mar 17, 2013 at 2:36 PM, Jafar Al-Gharaibeh <to.ja...@gmail.com>wrote:
> The introduction of threads introduced new "opportunities" for a few
> semantic changes regarding threads/co-expressions. These changes are under
> documented for two reasons:
> 1) finding the time to do so
> 2) finalizing/agreeing-on the the semantics before making them public.
>
> One of these changes is @, which has new sisters: @>, @>>, <@, and <<@.
> All of the latter operators accept a &nulll right hand side. @> and @>>
> interpret the &null as "produce and place in my outbox", the difference is
> that @> blocks if the outbox is full, but @>> never blocks, it just fails
> in that case. @> is send/produce, while <@ is receive/consume. @ was
> historically defined to combine both send/receive semantics, that semantic
> was retained, but it was extended to support &null-right-hand-side, which
> redirects send/receive to use the thread/co-expression inbox/outbox. For
> example in your program, when you do:
>
> 1@foo
>
> if foo is a co-expression. you should see the normal old fashion behavior
> of @. but if foo is &null (and it is in your case) , 1 is in &main outbox.
> &main then tries to grab a value from its inbox but we know there is no
> values there. &main blocks forever waiting for a value to be placed in its
> inbox, and that is why you had to do Ctrl-C.
>
> In summary, @ in this case is a combined @> (blocking send) followed by <@
> (a blocking receive). This has some "good" use case scenarios, even in a
> non-concurrent program.We can share some examples demonstrating such use
> but as I said, since this is not finalized it was kept in the dark. This
> will find its way into the thread TR and the Unicon book hopefully in the
> "near" future in whatever form it ended up being shaped.
>
> Any comments, feedback or reservations for that matter are welcome.
>
> Cheers,
> Jafar
>
>
>
> On Sun, Mar 17, 2013 at 1:24 PM, Clinton Jeffery <jeff...@cs.uidaho.edu>wrote:
>
>> Art,
>>
>> write(&null) has always been legal (and defined to write the empty
>> string) in Icon (and therefore Unicon). write() of course appends a
>> newline after that empty string.
>>
>> Attempting to transmit to &null should be a runtime error. No doubt some
>> recent changes to @ in order to support threads has messed something up.
>> We'll look into it.
>>
>> Cheers,
>> Clint
>>
>>
>> On Sun, Mar 17, 2013 at 6:29 AM, Art Eschenlauer <
>> esc...@alumni.princeton.edu> wrote:
>>
>>> I am not sure that this is peculiar to Win7 64-bit or if it's more
>>> general.
>>> As I recall, attempting to write &null resulted in a run-time error in
>>> Icon, yet now I get an empty string.
>>> Also, I expect attempts to transmit a value to &null (rather than to a
>>> co-expression) to generate a run-time error - instead, the program hangs
>>> (in an apparent infinite loop) until I press ^C.
>>> Am I missing something here?
>>>
>>> C:\tmp> type testIcon.icn
>>> procedure main()
>>> local foo
>>> write(&version)
>>> every write(&features)
>>> write("&error = ",&error)
>>> foo := &null
>>> write("zoo",foo,"bar")
>>> 1 @ foo
>>> end
>>>
>>> C:\tmp> .\testIcon.exe
>>> Unicon Version 12.1. August 12, 2012
>>> MS Windows NT
>>> POSIX
>>> DBM
>>> ASCII
>>> co-expressions
>>> concurrent threads
>>> dynamic loading
>>> environment variables
>>> event monitoring
>>> external functions
>>> keyboard functions
>>> large integers
>>> multiple programs
>>> pseudo terminals
>>> system function
>>> messaging
>>> graphics
>>> 3D graphics
>>> MS Windows
>>> Win32
>>> libz file compression
>>> JPEG images
>>> PNG images
>>> SQL via ODBC
>>> Binaries at C:\usr\Unicon\bin\
>>> &error = 0
>>> zoobar
>>> ^C
>>> C:\tmp>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Everyone hates slow websites. So do we.
>>> Make your web apps faster with AppDynamics
>>> Download AppDynamics Lite for free today:
>>> http://p.sf.net/sfu/appdyn_d2d_mar
>>> _______________________________________________
>>> Unicon-group mailing list
>>> Unicon-group@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/unicon-group
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Everyone hates slow websites. So do we.
>> Make your web apps faster with AppDynamics
>> Download AppDynamics Lite for free today:
>> http://p.sf.net/sfu/appdyn_d2d_mar
>> _______________________________________________
>> Unicon-group mailing list
>> Unicon-group@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/unicon-group
>>
>>
>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group