Ejemplo n.º 1
0
def read_seq(rdr):
    cnt = read_raw_integer(rdr)
    lst = [None] * cnt
    for x in range(cnt):
        lst[x] = read_obj(rdr)

    return create_from_list(lst)
Ejemplo n.º 2
0
def read_seq(rdr):
    cnt = read_raw_integer(rdr)
    lst = [None] * cnt
    for x in range(cnt):
        lst[x] = read_obj(rdr)

    return create_from_list(lst)
Ejemplo n.º 3
0
def maybe_oop_invoke(form):
    head = rt.first(form)
    if isinstance(rt.first(form), symbol.Symbol) and rt.name(head).startswith(".-"):
        postfix = rt.next(form)
        affirm(rt.count(postfix) == 1, u" Attribute lookups must only have one argument")
        subject = rt.first(postfix)
        kw = keyword(rt.name(head)[2:])
        fn = symbol.symbol(u"pixie.stdlib/-get-attr")
        return create_from_list([fn, subject, kw])

    elif isinstance(rt.first(form), symbol.Symbol) and rt.name(head).startswith("."):
        subject = rt.first(rt.next(form))
        postfix = rt.next(rt.next(form))
        form = cons(keyword(rt.name(head)[1:]), postfix)
        form = cons(subject, form)
        form = cons(symbol.symbol(u"pixie.stdlib/-call-method"), form)
        return form

    else:
        return form
Ejemplo n.º 4
0
def maybe_oop_invoke(form):
    head = rt.first(form)
    if isinstance(rt.first(form),
                  symbol.Symbol) and rt.name(head).startswith(".-"):
        postfix = rt.next(form)
        affirm(
            rt.count(postfix) == 1,
            u" Attribute lookups must only have one argument")
        subject = rt.first(postfix)
        kw = keyword(rt.name(head)[2:])
        fn = symbol.symbol(u"pixie.stdlib/-get-attr")
        return create_from_list([fn, subject, kw])

    elif isinstance(rt.first(form),
                    symbol.Symbol) and rt.name(head).startswith("."):
        subject = rt.first(rt.next(form))
        postfix = rt.next(rt.next(form))
        form = cons(keyword(rt.name(head)[1:]), postfix)
        form = cons(subject, form)
        form = cons(symbol.symbol(u"pixie.stdlib/-call-method"), form)
        return form

    else:
        return form
Ejemplo n.º 5
0
from rpython.translator.platform import platform
from pixie.vm.persistent_list import create_from_list
from pixie.vm.string import String
from pixie.vm.code import as_var
from rpython.rlib.clibffi import get_libc_name
import os

as_var("pixie.platform", "os")(String(unicode(os.name)))
as_var("pixie.platform", "name")(String(unicode(platform.name)))
as_var("pixie.platform", "so-ext")(String(unicode(platform.so_ext)))
as_var("pixie.platform", "lib-c-name")(String(unicode(get_libc_name())))

c_flags = []
for itm in platform.cflags:
    c_flags.append(String(unicode(itm)))

as_var("pixie.platform", "c-flags")(create_from_list(c_flags))

link_flags = []
for itm in platform.link_flags:
    c_flags.append(String(unicode(itm)))
as_var("pixie.platform", "link-flags")(create_from_list(link_flags))
Ejemplo n.º 6
0
from rpython.translator.platform import platform
from pixie.vm.persistent_list import create_from_list
from pixie.vm.string import String
from pixie.vm.code import as_var
from rpython.rlib.clibffi import get_libc_name
import os


as_var("pixie.platform", "os")(String(unicode(os.name)))
as_var("pixie.platform", "name")(String(unicode(platform.name)))
as_var("pixie.platform", "so-ext")(String(unicode(platform.so_ext)))
as_var("pixie.platform", "lib-c-name")(String(unicode(get_libc_name())))

c_flags = []
for itm in platform.cflags:
    c_flags.append(String(unicode(itm)))

as_var("pixie.platform", "c-flags")(create_from_list(c_flags))

link_flags = []
for itm in platform.link_flags:
    c_flags.append(String(unicode(itm)))
as_var("pixie.platform", "link-flags")(create_from_list(link_flags))