diff --git a/cpp-lib/cpp/cpp.pro b/cpp-lib/cpp/cpp.pro index e40fc9e..f866983 100644 --- a/cpp-lib/cpp/cpp.pro +++ b/cpp-lib/cpp/cpp.pro @@ -1,24 +1,10 @@ QT += widgets TEMPLATE = lib CONFIG += plugin release no_keywords -LIBS += -L/usr/local/lib -lecl DESTDIR = ../ TARGET = cpp OBJECTS_DIR = ./tmp/ MOC_DIR = ./tmp/ -win32 { - include(../../src/windows.pri) -} - -# 'marshal.*' and 'qt_ecl.*' only needed for calling Lisp - -HEADERS += \ - lib.h \ - ../../src/cpp/marshal.h \ - ../../src/cpp/qt_ecl.h - -SOURCES += \ - lib.cpp \ - ../../src/cpp/marshal.cpp \ - ../../src/cpp/qt_ecl.cpp +HEADERS += lib.h +SOURCES += lib.cpp diff --git a/cpp-lib/cpp/lib.cpp b/cpp-lib/cpp/lib.cpp index 9e45f5d..519ca5e 100644 --- a/cpp-lib/cpp/lib.cpp +++ b/cpp-lib/cpp/lib.cpp @@ -1,5 +1,4 @@ #include "lib.h" -#include "../../src/cpp/ecl_fun.h" // for calling Lisp #include #include #include @@ -33,9 +32,4 @@ QVariant CPP::hello(const QVariant& arg) { return arg; } -QVariant CPP::callLisp(const QVariant& arg) { - - return ecl_fun("cl:format", false, "~R", arg); -} - QT_END_NAMESPACE diff --git a/cpp-lib/cpp/lib.h b/cpp-lib/cpp/lib.h index 2152ce4..bb9f9a1 100644 --- a/cpp-lib/cpp/lib.h +++ b/cpp-lib/cpp/lib.h @@ -19,8 +19,8 @@ class CPP : public QObject { public: // max. 10 arguments of type QVariant // return type must also be a QVariant + Q_INVOKABLE QVariant hello(const QVariant&); - Q_INVOKABLE QVariant callLisp(const QVariant&); }; QT_END_NAMESPACE diff --git a/cpp-lib/readme.md b/cpp-lib/readme.md index a504bcc..e69247e 100644 --- a/cpp-lib/readme.md +++ b/cpp-lib/readme.md @@ -27,14 +27,3 @@ So, we pass a nested Lisp list, and it gets converted and shown on Qt side with the respective types. Then the `QVariantList` is returned to Lisp, where it is automatically converted back to a nested Lisp list. -Really convenient! - -From the second function -- which calls back to Lisp -- we can see that it -suffices to simply pass some intuitive, primitive C++ values to `ecl_fun`, -which will be converted automatically (using `QVariant`) to the appropriate -Lisp values. - -**Conclusion**: by only allowing `QVariant` arguments for calls between Lisp -and C++/Qt, we simplify things to a point where it becomes trivial, especially -considering nested lists on both sides. - diff --git a/cpp-lib/run.lisp b/cpp-lib/run.lisp index d9b2ebe..6539c91 100644 --- a/cpp-lib/run.lisp +++ b/cpp-lib/run.lisp @@ -6,5 +6,3 @@ (qrun* (print (hello *cpp* '(1 "two" (1.25 #(50 -50 75)))))) -(qrun* (print (call-lisp *cpp* 125))) -