Only tacit asserts report the correct location
of error in the user code. Explitic asserts
report error in its own body, which is useless.
Currently in jsocket, sdcheck is defined as
sdcheck=: 3 : 'if. 0~:>{.y do. (sderror y) 13!:8 [ 3 else. }. y end.'
As a result we have,
c=. 'jssc' conew~ 1200;'localhost';2;1
|EWOULDBLOCK: sdcheck
| (sderror y) 13!:8[3
Now if redifined as tacit (note also becoming more compact and J-like),
sdcheck_jsocket_=: }. ` (sderror 13!:8 3:) @. (0 ~: >@{.)
we have,
c=. 'jssc' conew~ 1200;'localhost';2;1
|EWOULDBLOCK: sdcheck
| sdcheck sdconnect sk;(sdcheck sdgethostbyname host),<port
which exactly shows the point in code where error occurred.
____________________________________________________________________________________
8:00? 8:25? 8:40? Find a flick in no time
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm