The current type function for socket in std/socket.e is
public type socket(object o)
if not sequence(o) then return 0 end if
if not length(o) = 2 then return 0 end if
if not atom(o[1]) then return 0 end if
if not atom(o[2]) then return 0 end if
return 1 end type
The second if statement has an error. It should be either
if not (length(o) = 2) then
or
if length(o) != 2 then
In current version the "not" is being applied to the length(o) only, not the whole expression, causing a call like "if socket({}) then" to crash.
changeset: 4974:5c72e2e652e0 branch: 4.0 user: Matt Lewis date: Tue Jun 21 08:24:58 2011 -0400 files: tests/t_socket.e description:
changeset: 4975:00f72581ad33 branch: 4.0 user: Matt Lewis date: Tue Jun 21 08:26:58 2011 -0400 files: docs/release/4.0.3.txt include/std/socket.e description: