Package seph.lang.persistent

Examples of seph.lang.persistent.PersistentList$EmptyList


                    top.push(13, result, false);
                    result.firstArgument = last;
                } else {
                    List<Message> currentChain = top.currentMessageChain;
                    Message last = currentChain.remove(currentChain.size() - 1);
                    currentChain.add(NamedMessage.create(name, new PersistentList(last), null, sourcename, l, cc, scope));
                    top.added();
                }
            } else {
                top.currentMessageChain.add(NamedMessage.create(name, null, null, sourcename,  l, cc, scope));
                top.added();
View Full Code Here


        throw new RuntimeException("ESCAPED MUTABLE MESSAGE");
    }

    public Message withNext(Message newNext) {
        IPersistentList args = realArguments == null ? null :
            (firstArgument == null ? new PersistentList(realArguments) : PersistentList.create(Arrays.asList(firstArgument, realArguments)));

        return NamedMessage.create(name, args, newNext, filename, line, position, scope);
    }
View Full Code Here

        assertEquals("fox", msg.withNext(null).name());
    }

    @Test
    public void with_next_returns_a_new_object_with_the_same_arguments() {
        IPersistentList expected = new PersistentList(null);
        NamedMessage msg = NamedMessage.create(null, expected, null, null, 0, 0, null);
        assertSame(expected, msg.withNext(null).arguments());
    }
View Full Code Here

    }

    public Object evaluateStream(String name, Reader reader) throws ControlFlow, IOException {
        Parser p = new Parser(this, reader, name);
        Message msg = (Message)p.parseFully().seq().first();
        Abstraction amsg = (Abstraction)NamedMessage.create("#", new PersistentList(msg), null, "<init>", -1, -1, p.scope);
        SephObject so = DefaultAbstraction.createFrom(amsg, LexicalScope.create(null, Ground.instance, this, new String[0]), "toplevel");
        SThread thread = new SThread(this);
        SephObject tmp = null;
        try {
            tmp = (SephObject)so.activationFor(0, false).invokeExact((SephObject)Ground.instance, thread, (LexicalScope)null);
View Full Code Here

TOP

Related Classes of seph.lang.persistent.PersistentList$EmptyList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.