Skip to main content

import lang.[python,lisp,...]

Project description


author:

  • Marco Heisig title: 'A library for cross-language interoperability.'

The lang module/system/library can be loaded from multiple programming languages to seamlessly integrate all the other supported ones. The currently supported languages are Python and Lisp.

Installation

Requires libsbcl in your library path if you want to load Lisp into Python.

Requires libpython3.11 or later in your library path if you want to load Python into Lisp.

Showcases

(in-package #:cl-user)
(sb-ext:add-package-local-nickname '#:python '#:lang.python)

(python:list #(1 2.0 #c(3 4) "5 6"))
 => [1, 2.0, #C(3 4) "5 6"]

(python:tuple (python:map #'class-of *))
 => (<class 'lang.common-lisp.fixnum'>,
     <class 'lang.common-lisp.single-float'>,
     <class 'lang.common-lisp.complex'>,
     <class 'lang.sb-kernel.simple-character-string'>)

(python:getitem (python:dir 42) (python:slice 5))
 => ['__class__', '__bool__', '__and__', '__add__', '__abs__']

(python:isinstance (python:getitem (python:dir 42) 0) (find-class 'python:str))
 => True

(typep (python:getitem (python:dir 42) 0) 'python:str)
 => t

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lang-0.1.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

lang-0.1-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page