Skip to content

Commit

Permalink
fixing some uses of Set for new constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Jun 24, 2011
1 parent a953a63 commit 866f802
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions j/process.j
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ type Cmd
function Cmd(exec::Executable)
this = new(exec,
HashTable{FileDes,PipeEnd}(),
Set(Cmd),
Set{Cmd}(),
0,
ProcessNotRun())
add(this.pipeline, this)
Expand Down Expand Up @@ -182,7 +182,7 @@ end
fd(cmd::Cmd, f::FileDes) = Port(cmd,f)

function fd(cmds::Set{Cmd}, f::FileDes)
set = Set(Port)
set = Set{Port}()
for cmd = cmds
if !has(cmd.pipes, f)
add(set, fd(cmd,f))
Expand All @@ -204,7 +204,7 @@ stderr(cmds::Cmds) = fd(cmds,STDERR)
cmds(port::Port) = set(port.cmd)

function cmds(ports::Ports)
c = Set(Cmd)
c = Set{Cmd}()
for port = ports
add(c, port.cmd)
end
Expand All @@ -214,15 +214,15 @@ end
## building connected and disconnected pipelines ##

function (&)(cmds::Cmds...)
set = Set(Cmd)
set = Set{Cmd}()
for cmd = cmds
add(set, cmd)
end
set
end

function (&)(ports::Ports...)
set = Set(Port)
set = Set{Port}()
for port = ports
add(set, port)
end
Expand Down Expand Up @@ -250,7 +250,7 @@ end

function join(cmds::Cmds)
if length(cmds) > 1
pipeline = Set(Cmd)
pipeline = Set{Cmd}()
for cmd = cmds
add(pipeline, cmd.pipeline)
end
Expand Down Expand Up @@ -301,7 +301,7 @@ running(cmd::Cmd) = (cmd.pid > 0)
# spawn(cmd) starts all processes connected to cmd

function spawn(cmd::Cmd)
fds = Set(FileDes)
fds = Set{FileDes}()
for c = cmd.pipeline
if running(c)
error("already running: ", c)
Expand Down

0 comments on commit 866f802

Please sign in to comment.