Code Monkey home page Code Monkey logo

mlisa's Introduction

mLisa

Lisp production-rule system (LISA) modified for JSCL.

A fork of http://lisa.sourceforge.net/. Fossil Lisp code, ancient as mammoth's shit

Compilation only under web-repl (platform Electron)

(setq bin #())
(load "00-prelude.lisp" :hook bin)
(load "01-utils.lisp" :hook bin)
(load "02-belief.lisp" :hook bin)
(load "03-reflect.lisp" :hook bin)
(load "04-core.lisp" :hook bin)
(load "05-rete.lisp" :hook bin)
(load "06-config.lisp" :hook bin :output "lisa.js")

Will be bundle js-code "lisa.js".

Compilation "lisa.js" look at https://github.com/vlad-km/mLisa/releases v0.1-alpha First iteration

Use with browser

File jscl.html:

    <script src="lisa.js" type="text/javascript"></script>
    <script src="jscl-web.js" type="text/javascript"></script>
(deftemplate hobbit () 
    (slot name) (slot age))

(defrule r-1 ()
     (hobbit (name ?name) (age ?age))
=>
 (format t "Spawn hobbit ~a ~a ~%" ?name ?age))

(defrule r-2 ()
    (hobbit (name gendalf) (age 100))
=>
 (format t "Spawn wizard, ancient as mammoth's shit~%"))

(assert> (hobbit (name frodo)(age 30)))
(assert> (hobbit (name bilbo)(age 50)))
(assert> (hobbit (name gendalf)(age 100)))
  • General view general view

What's next

Read original documentation. Have a fun.

As is, without any guarantees or obligations

mlisa's People

Contributors

vlad-km avatar

Watchers

 avatar  avatar

mlisa's Issues

Assert instance

CL-USER> (deftemplate frob () (slot name) (slot slot))
#<standard-class FROB>
CL-USER> (deftemplate e1 ())
#<standard-class E1>
CL-USER> (setq ?ff (assert> (e1)))
#<instance FACT E1 6 (..) NIL E1 STANDARD-CLASSNIL FACT-META-OBJECT STRUCTURE-CLASS>
CL-USER> (assert> (frob (slot ?ff)))
ERROR: Maximum call stack size exceeded

Assert

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.