Giter VIP home page Giter VIP logo

omglib's People

Contributors

hemml avatar inasangit avatar nagy avatar wmealing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

nagy

omglib's Issues

Some systems failed to build for Quicklisp dist

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">

Full log here

The code assumes that (setf (apply #'gethash .. works, but it is not required in common-lisp

in omg.lisp, (setf gethash-lock)

(defun (setf gethash-lock) (val &rest args)

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)))

Variable evaluation bug ?

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

omgui:create-element throws error

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

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.