guicho271828 / trivia

Pattern Matcher Compatible with Optima
Other
334 stars 22 forks source link

compile fails on ECL-Android #40

Closed dto closed 8 years ago

dto commented 8 years ago

Using git head Trivia on ECL-Android with the new (progn (signal 'wildcard)) fix, but behavior is unchanged and still signals during compilation.

(asdf:load-system :trivia) ......... ......... ;;; Compiling input stream /data/data/org.lisp.ecl/app_resources/home/quicklisp/local-projects/trivia/level2/derived3.lisp

[Condition of type TRIVIA.LEVEL2.IMPL::WILDCARD]

dto commented 8 years ago

I should note that I am building this on the host Android system using the ECL byte-compiler.

guicho271828 commented 8 years ago

wildcard is a condition, but not a subclass of error which is in tern a subclass of serious-condition. I mean the compilation should not stop here because it can be simply ignored. I suspect ECLAndroid-specific bug.

Or, ensure that *break-on-signals* is set to NIL. This is a flag mainly used for debugging, which forces the implementation to enter the debugger capturing any conditions, rather than ignoring non-serious conditions. This should be set to NIL in deployment. http://clhs.lisp.se/Body/v_break_.htm

guicho271828 commented 8 years ago

new (progn (signal 'wildcard)) fix

The error actually related to this fix is not wildcard, although yes, I mechanically grep'ed all signal into (progn (signal ...)). Sorry for my confusing fix.

The related code is a condition named deferred, https://github.com/guicho271828/trivia/blob/master/level2/impl.lisp#L328

which is signaled here, https://github.com/guicho271828/trivia/blob/master/level2/impl.lisp#L368

and handled here, https://github.com/guicho271828/trivia/blob/master/level2/impl.lisp#L348

and the error should be slot-unbound, not wildcard. https://gitlab.com/embeddable-common-lisp/ecl/issues/247

dto commented 8 years ago

hi, break-on-signals is bound to Nil at the top level (not sure if ASDF is doing any rebinding, though)

guicho271828 commented 8 years ago

could you find a macroexpansion of restart-case form? also, what happens if you evaluate (define-condition mycond () ()) (signal 'mycond) on ECLAndroid ?

dto commented 8 years ago

CL-USER> (define-condition mycond () ()) (signal 'mycond) ; Evaluation aborted on #.

Which restart-case form are you asking me to macroexpand?

dto commented 8 years ago

Here is the macroexpansion of the restart-case from impl.lisp:29

(BLOCK #:G252
  (LET ((#:G253 NIL))
    (TAGBODY
      (RESTART-BIND
       ((CONTINUE
         #'(LAMBDA (&REST SI::TEMP) (SETQ #:G253 SI::TEMP) (GO #:G254))))
       (RETURN-FROM #:G252 (PROGN (SIGNAL 'WILDCARD))))
     #:G254
      (RETURN-FROM #:G252 (APPLY #'(LAMBDA ()) #:G253)))))
guicho271828 commented 8 years ago

CL-USER> (define-condition mycond () ()) (signal 'mycond) ; Evaluation aborted on #.

Does this mean it entered the debugger? If so, this should not happen in a conforming inplementation. signal should return NIL.

guicho271828 commented 8 years ago

For example,

CL-USER> (define-condition mycond () ())
MYCOND
CL-USER> (signal 'mycond)
NIL
CL-USER> (lisp-implementation-type)
"SBCL"
CL-USER> (lisp-implementation-version)
"1.3.5"
dto commented 8 years ago

Attempting to macroexpand the one on line 366 causes an error: (:emacs-rex (swank:swank-macroexpand-1 nil) ":trivia.level2.impl" t 5) (:return (:abort "#")

guicho271828 commented 8 years ago

My fix was for the bug of restart-case. However, your case revealed that AndroECL's signal is broken. These are two independent bugs in ECL.

dto commented 8 years ago

I am doing another check to make sure my own handler-case around (start-swank) wasn't causing an issue

guicho271828 commented 8 years ago

okay

guicho271828 commented 8 years ago

its 2 am and I am dead sleepy. sorry I will reply tomorrow

dto commented 8 years ago

Ok, the problem was my own HANDLER-CASE. I was catching CONDITION when i really should have been catching ERROR. Trivia now compiles/loads without trouble. INLINED-GENERIC-FUNCTION also loads now, and I"ll be testing it out. sorry for the trouble.