hemml / omglib Goto Github PK
View Code? Open in Web Editor NEWA Common Lisp library to build fully dynamic web interfaces
License: GNU General Public License v3.0
A Common Lisp library to build fully dynamic web interfaces
License: GNU General Public License v3.0
Building with SBCL 2.2.3.156-e971aa48f / ASDF 3.3.5 for quicklisp dist creation.
Trying to build commit id 5ad68c6
omg fails to build with the following error:
; caught WARNING:
; undefined variable: JSCL::*ENVIRONMENT*
...
; caught WARNING:
; 2 more uses of undefined variable JSCL::*ENVIRONMENT*
...
; caught ERROR:
; READ error during COMPILE-FILE: Package QL does not exist. Line: 20, Column: 17, File-Position: 1103 Stream: #<SB-INT:FORM-TRACKING-STREAM for "file /home/quicklisp/quicklisp-controller/dist/build-cache/omglib/0bed5a6930be8cbb95571fb80d5653ab9842285b/omglib-20220421-git/omgdaemon.lisp" {10133865F3}>
...
Unhandled UIOP/LISP-BUILD:COMPILE-FILE-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING {1041248073}>: COMPILE-FILE-ERROR while compiling #<CL-SOURCE-FILE "omg" "omgdaemon">
in omg.lisp, (setf gethash-lock)
Line 53 in 5926b20
uses (setf (apply #'gethash args) val)))
, but the common-lisp standard does not gurantee that this is a valid form. The standard only guarantees that aref, bit and sbit can be used this way. For other standardized function it is left to the implementation.
http://www.lispworks.com/documentation/HyperSpec/Body/05_abe.htm
In LispWorks it doesn't work
Since the arguments to gethash are known, there is no reason not to put them explicitly, Something like:
(defun (setf gethash-lock) (val key table &optional default)
(declare (ignore default)) ; (setf (getahsh ..)) also ignores the default
(if *giant-hash-lock*
(bt:with-lock-held (*giant-hash-lock*)
(setf (gethash key table) val))
(setf (gethash key table) val)))
I am having some trouble understanding whether the following is a bug or not.
Say, I have a an init file like this:
(require :omg)
(defpackage :my-test (:use cl omg omgui jscl))
(in-package :my-test)
(defparameter-f *some-data* #(1 2 3))
(defun-f some-function ()
(jslog *some-data*)
(length *some-data*))
(defun-r my-boot ()
(jslog (some-function)))
(add-to-boot '(my-boot))
(restart-server)
I executed that code above via sly and pointed a browser at it. When I then empty the list:
CL-USER> (in-package :my-test)
#<PACKAGE "MY-TEST">
MY-TEST> (defparameter-f *some-data* nil)
NIL
MY-TEST>
My expectation would be that (some-function)
now returns 0
. But instead I get:
MY-TEST> (remote-exec '(some-function))
(3)
MY-TEST> (remote-exec '*some-data*)
(NIL)
MY-TEST>
You can see that the function return value is wrong, but the data behind it got updated correctly.
Is this expected behavior? If not, is there some way I can help in fixing this?
I suspect this has something todo with how javascript closes over its function values:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures
hi,
attempted to try the example from the README page:
(omgui:create-element "div" :|innerHTML| "Some text" :|style.fontWeight| "lighter")
and got this error in the REPL:
`illegal sharp macro character: #<
Stream: #<dynamic-extent STRING-INPUT-STREAM (unavailable) from "(#<JS-OB...">
[Condition of type SB-INT:SIMPLE-READER-ERROR]
Restarts:
0: [RETRY] Retry SLIME REPL evaluation request.
1: [*ABORT] Return to SLIME's top level.
2: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {1001540533}>)
Backtrace:
0: (SB-IMPL::SHARP-ILLEGAL #<SB-IMPL::STRING-INPUT-STREAM {7F6670BC5C63}> #< #)
1: (SB-IMPL::READ-MAYBE-NOTHING #<SB-IMPL::STRING-INPUT-STREAM {7F6670BC5C63}> ##)
2: (SB-IMPL::READ-LIST #<SB-IMPL::STRING-INPUT-STREAM {7F6670BC5C63}> #)
3: (SB-IMPL::READ-MAYBE-NOTHING #<SB-IMPL::STRING-INPUT-STREAM {7F6670BC5C63}> #()
4: (SB-IMPL::%READ-PRESERVING-WHITESPACE #<SB-IMPL::STRING-INPUT-STREAM {7F6670BC5C63}> T (NIL) T)
5: (SB-IMPL::%READ-PRESERVING-WHITESPACE #<SB-IMPL::STRING-INPUT-STREAM {7F6670BC5C63}> T (NIL) NIL)
6: (READ #<SB-IMPL::STRING-INPUT-STREAM {7F6670BC5C63}> T NIL NIL)
7: (SB-IMPL::%READ-FROM-STRING "(#<JS-OBJECT [object HTMLDivElement]>)" T NIL 0 NIL NIL)
8: ((FLET OMG::EXEC :IN OMG:REMOTE-EXEC))
9: (OMG:REMOTE-EXEC (OMGUI:CREATE-ELEMENT "div" :|innerHTML| "Some text" :|style.fontWeight| "lighter") NIL)
10: (SB-INT:SIMPLE-EVAL-IN-LEXENV (OMGUI:CREATE-ELEMENT "div" :|innerHTML| "Some text" :|style.fontWeight| "lighter") #)
11: (EVAL (OMGUI:CREATE-ELEMENT "div" :|innerHTML| "Some text" :|style.fontWeight| "lighter"))
`
I'm using SBCL 2.1.6.31-7127ea27f
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.