String specName = "AnonFilter" + varGen.nextVarNum();
String specName = "AnonFilter_" + varGen.getPrefix() + varGen.nextVarNum();
    public Object visitSCAnon(SCAnon creator)    {        // First, replace things in children.        StreamSpec newSpec = (StreamSpec)creator.getSpec().accept(this);                // Wrap this in an empty symbol table, and look for free        // variables.        final Set freeVars = new java.util.TreeSet();        newSpec.accept(new SymbolTableVisitor(null) {                public Object visitExprVar(ExprVar expr)                {                    Object result = super.visitExprVar(expr);                    if (!(symtab.hasVar(expr.getName())))                        freeVars.add(expr.getName());                    return result;                }            });        // Create a top-level StreamSpec for this.        String specName = "AnonFilter" + varGen.nextVarNum();        List formals = new java.util.ArrayList();        List params = new java.util.ArrayList();        for (Iterator iter = freeVars.iterator(); iter.hasNext(); )        {            String name = (String)iter.next();            Expression var = new ExprVar(creator.getContext(), name);            // Arrays are special: we need an extra parameter for            // their length.            Type type = getType(var);            if (type instanceof TypeArray)            {                params.add(((TypeArray)type).getLength());                formals.add(new Parameter                            (new TypePrimitive(TypePrimitive.TYPE_INT),                             "_len_" + name));            }            params.add(var);            formals.add(new Parameter(getType(var), name));        }        StreamSpec namedSpec = new StreamSpec(newSpec.getContext(),                                              newSpec.getType(),                                              newSpec.getStreamType(),                                              specName,                                              formals,                                              newSpec.getVars(),                                              newSpec.getFuncs());        newStreams.add(namedSpec);                // Also replace the stream creator.  The only thing we        // need to create here is the list of parameters.        return new SCSimple(creator.getContext(),                            specName,                            Collections.EMPTY_LIST,                            params,                            Collections.EMPTY_LIST);    }