Michał "phoe" Herda activity https://gitlab.com/phoe 2024-02-06T19:44:39Z tag:gitlab.com,2024-02-06:3142480086 Michał "phoe" Herda commented on merge request !3 at clisp / clisp 2024-02-06T19:44:39Z phoe Michał "phoe" Herda [email protected]

I don't know, I have no merge rights to the clisp repository.

tag:gitlab.com,2022-12-11:2285161415 Michał "phoe" Herda opened issue #687: (aref #(0 1) "0") provides a confusing error message at Embeddable Common-Lisp / ECL 2022-12-11T18:41:45Z phoe Michał "phoe" Herda [email protected]
> (aref #(0 1) "0")

Condition of type: SIMPLE-TYPE-ERROR
In function AREF, the index into the object
 #(0 1).
takes a value 0 out of the range (INTEGER 0 1).

The value should be printed as "0" not 0 (~S versus ~A).

>> (format t "~&~@{~12@A ~S~%~}"
        :version (lisp-implementation-version)
        :vcs-id (ext:lisp-implementation-vcs-id)
        :os (software-type)
        :os-version (software-version)
        :machine-type (machine-type)
        :features *features*)

     VERSION "21.2.1"
      VCS-ID "c646799145538997d84ed6d8755be7e7837eb7ef"
          OS "Linux"
  OS-VERSION "6.0.0-6-amd64"
MACHINE-TYPE "x86_64"
    FEATURES (:WALKER :CDR-1 :CDR-5 :LINUX :FORMATTER :CDR-7 :ECL-WEAK-HASH :LITTLE-ENDIAN :ECL-READ-WRITE-LOCK :LONG-LONG :UINT64-T :UINT32-T :UINT16-T :COMPLEX-FLOAT :LONG-FLOAT :UNICODE ...)
tag:gitlab.com,2022-02-27:1743471199 Michał "phoe" Herda commented on merge request !270 at Embeddable Common-Lisp / ECL 2022-02-27T22:34:13Z phoe Michał "phoe" Herda [email protected]

Would you mind also adding a regression test case which verifies the correct scenario?

tag:gitlab.com,2022-02-07:1706827792 Michał "phoe" Herda opened issue #675: Attempting to read 1d9999999999999 exhausts the heap at Embeddable Common-Lisp / ECL 2022-02-07T23:11:03Z phoe Michał "phoe" Herda [email protected]

Attempting to read 1d9999999999999 causes ECL to hang in a busy loop and allocate memory until it runs out of heap space.

     VERSION "21.2.1"
      VCS-ID "c646799145538997d84ed6d8755be7e7837eb7ef"
          OS "Linux"
  OS-VERSION "5.15.0-2-amd64"
MACHINE-TYPE "x86_64"
    FEATURES (:WALKER :CDR-1 :CDR-5 :LINUX :FORMATTER :CDR-7 :ECL-WEAK-HASH
              :LITTLE-ENDIAN :ECL-READ-WRITE-LOCK :LONG-LONG :UINT64-T
              :UINT32-T :UINT16-T :COMPLEX-FLOAT :LONG-FLOAT :UNICODE :DFFI
              :CLOS-STREAMS :CMU-FORMAT :UNIX :ECL-PDE :DLOPEN :CLOS :THREADS
              :BOEHM-GC :ANSI-CL :COMMON-LISP :FLOATING-POINT-EXCEPTIONS
              :IEEE-FLOATING-POINT :PACKAGE-LOCAL-NICKNAMES :CDR-14
              :PREFIXED-API :FFI :X86_64 :COMMON :ECL)
tag:gitlab.com,2022-01-31:1692774776 Michał "phoe" Herda commented on merge request !3 at clisp / clisp 2022-01-31T09:46:02Z phoe Michał "phoe" Herda [email protected]

This helps - thank you!

[1]> (ql:quickload :alexandria)
To load "alexandria":
  Load 1 ASDF system:
    alexandria
; Loading "alexandria"
[package alexandria]..............................
[package alexandria-2].
(:ALEXANDRIA)

[2]> (defpackage #:foo (:use #:cl) (:local-nicknames (#:a #:alexandria)))
#<PACKAGE FOO>

[3]> (in-package #:foo)
#<PACKAGE FOO>

FOO[4]> (find-package :a)
#<PACKAGE ALEXANDRIA>
tag:gitlab.com,2022-01-29:1691589431 Michał &quot;phoe&quot; Herda commented on merge request !3 at clisp / clisp 2022-01-29T22:49:43Z phoe Michał "phoe" Herda [email protected]

@joramschrijver Found one issue with this patch - gensyms are not correctly recognized in :LOCAL-NICKNAMES.

[2]> (defpackage #:foo            
       (:use #:cl)
       (:local-nicknames (#:a #:alexandria)))

*** - EVAL-WHEN: variable #:A has no value
The following restarts are available:
USE-VALUE      :R1      Input a value to be used instead of #:A.
STORE-VALUE    :R2      Input a new value for #:A.
ABORT          :R3      Abort main loop
Break 1 [3]> 

The reason is lack of quoting of function arguments in the EXT:ADD-PACKAGE-LOCAL-NICKNAME call:

FOO[6]> (macroexpand-1 '(defpackage #:foo (:use #:cl) (:local-nicknames (#:a #:alexandria))))
(EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE)
 (SYSTEM::%IN-PACKAGE "FOO" :NICKNAMES 'NIL :USE 'NIL :CASE-SENSITIVE NIL :CASE-INVERTED NIL)
 (USE-PACKAGE '("COMMON-LISP") "FOO")
 (DOLIST (SYSTEM::MAPPING (EXT:PACKAGE-LOCAL-NICKNAMES "FOO"))
  (EXT:REMOVE-PACKAGE-LOCAL-NICKNAME (CAR SYSTEM::MAPPING) "FOO"))
 (EXT:ADD-PACKAGE-LOCAL-NICKNAME #:A #:ALEXANDRIA "FOO") (FIND-PACKAGE "FOO")) ;

Is it possible for you to make a new commit on top of your branch? I'll cherry-pick it on top of the Roswell fork at https://github.com/roswell/clisp/ so ros install clisp-head fetches it.

tag:gitlab.com,2022-01-29:1691518932 Michał &quot;phoe&quot; Herda commented on issue #672 at Embeddable Common-Lisp / ECL 2022-01-29T19:33:21Z phoe Michał "phoe" Herda [email protected]

Perfect, thank you!

tag:gitlab.com,2022-01-29:1691198388 Michał &quot;phoe&quot; Herda commented on merge request !3 at clisp / clisp 2022-01-29T09:08:58Z phoe Michał "phoe" Herda [email protected]

What else is required to merge this upstream and make a new release?

It's getting hard to keep on working with CLISP, since more and more CL code depends on package-local nicknames, and keeping that software working on CLISP requires keeping and downloading a separate PLN-less branch for it.

tag:gitlab.com,2022-01-24:1680899798 Michał &quot;phoe&quot; Herda opened issue #672: MULTIPLE-VALUE-CALL with too many arguments does not signal PROGRAM-ERROR at Embeddable Common-Lisp / ECL 2022-01-24T15:04:43Z phoe Michał "phoe" Herda [email protected]

Found via https://github.com/ruricolist/serapeum/pull/109

Attempting to multiple-value-call a (lambda (one two) ...) with (values 1 2 3) does not signal a program-error.

ECL (Embeddable Common-Lisp) 21.2.1 (git:c646799145538997d84ed6d8755be7e7837eb7ef)
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2013 Juan J. Garcia-Ripoll
Copyright (C) 2018 Daniel Kochmanski
Copyright (C) 2021 Daniel Kochmanski and Marius Gerbershagen
ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help.  
Top level in: #<process TOP-LEVEL 0x55c5648bbf80>.

> (declaim (optimize safety))
((OPTIMIZE SAFETY))

> (compile nil '(lambda () (MULTIPLE-VALUE-CALL (LAMBDA (ONE TWO) (LIST ONE TWO)) (VALUES 1 2 3))))
;;; OPTIMIZE levels: Safety=3, Space=0, Speed=3, Debug=0
;;;
;;; End of Pass 1.
#<compiled-function 0x55c565112ac0>
NIL
NIL

> (funcall *)
(1 2)

No error is signaled in safe code, which is in violation of CLHS 3.5.1.3.

The same behavior occurs in code compiled with default safety.

tag:gitlab.com,2022-01-10:1656444449 Michał &quot;phoe&quot; Herda opened issue #668: Restore instances to their previous state on failed U-I-F-{R,D}-C at Embeddable Common-Lisp / ECL 2022-01-10T17:21:49Z phoe Michał "phoe" Herda [email protected]

Would you welcome a patch that adds the functionality from https://github.com/sbcl/sbcl/commit/9dcaef6100feae2f99b8b524d2ee702789eaf38f into ECL? The commit message and tests should be the most interesting parts for you.

Commit message, copied over for posterity:

Neither the standard nor the MOP specify what happens when an error is
signaled in U-I-F-R-C or U-I-F-D-C and control is transferred outside.
This may result in half-baked instances which, respectively, already
have their structure or class changed, but whose newly added slots are
not yet initialized. There is no good way to "fix" the instances afterwards
since, for all purposes, SBCL considers them to be "updated" even though
their slot values are undefined.

This commit modifies the existing behavior in functions
%OBSOLETE-INSTANCE-TRAP and %CHANGE-CLASS by effectively rolling back
the transaction of updating an instance or changing its class if
U-I-F-{R,D}-C does not exit normally but via a nonlocal exit.

The new behavior is actually useful because the programmer can fix
their U-I-F-{R,D}-C code up and either attempt to access the instance
again (to trigger the update process) or call CHANGE-CLASS on it again.

Tests:


It seems that the change could be done in https://gitlab.com/embeddable-common-lisp/ecl/-/blob/4da8ca54b60e373cf8f344601e19daabbac25437/src/clos/change.lsp#L148-180 by saving the old instance stamp and contents, and then adding an UNWIND-PROTECT form, which, in case of a non-local exit, could restore the old state of the instance.

(Edit: I would like to add a tag "feature" to this issue, but I don't seem to have the permission to do that.)

tag:gitlab.com,2021-12-28:1639235698 Michał &quot;phoe&quot; Herda commented on merge request !3 at clisp / clisp 2021-12-28T10:04:48Z phoe Michał "phoe" Herda [email protected]

What else is required to merge this upstream and make a new release?

tag:gitlab.com,2021-01-26:1084890431 Michał &quot;phoe&quot; Herda opened issue #1: Mention the original Y Combinator Codex at Benjamin Slade / Y combinator-codex 2021-01-26T13:00:21Z phoe Michał "phoe" Herda [email protected]

https://imgur.com/a/na4Q5SK

tag:gitlab.com,2020-12-20:1039388054 Michał &quot;phoe&quot; Herda opened issue #617: Multiple values returned from PROG1 when body is empty at Embeddable Common-Lisp / ECL 2020-12-20T15:53:02Z phoe Michał "phoe" Herda [email protected]

Moved from https://gitlab.common-lisp.net/ecl/ecl/-/issues/2

(prog1 (values 1 2 3)) is supposed to return only the primary value.

Possible fix at https://gitlab.com/embeddable-common-lisp/ecl/-/blob/develop/src/lsp/evalmacros.lsp#L233-239:

(defmacro prog1 (first &rest body &aux (sym (gensym)))
  "Syntax: (prog1 first-form {form}*)
Evaluates FIRST-FORM and FORMs in order.  Returns the value of FIRST-FORM."
  (if (null body) `(values ,first)
  `(LET ((,sym ,first))
;    (DECLARE (:READ-ONLY ,sym)) ; Beppe
    ,@body ,sym)))

ECL data:

     VERSION "20.4.24"
      VCS-ID "UNKNOWN"
          OS "Linux"
  OS-VERSION "5.9.0-2-amd64"
MACHINE-TYPE "x86_64"
    FEATURES (:WALKER :CDR-1 :CDR-5 :LINUX :FORMATTER :CDR-7 :ECL-WEAK-HASH
              :LITTLE-ENDIAN :LONG-LONG :UINT64-T :UINT32-T :UINT16-T
              :COMPLEX-FLOAT :LONG-FLOAT :UNICODE :DFFI :CLOS-STREAMS
              :CMU-FORMAT :UNIX :ECL-PDE :DLOPEN :CLOS :THREADS :BOEHM-GC
              :ANSI-CL :COMMON-LISP :FLOATING-POINT-EXCEPTIONS
              :IEEE-FLOATING-POINT :PACKAGE-LOCAL-NICKNAMES :CDR-14
              :PREFIXED-API :FFI :X86_64 :COMMON :ECL)
tag:gitlab.com,2020-11-14:989242004 Michał &quot;phoe&quot; Herda commented on merge request !233 at Embeddable Common-Lisp / ECL 2020-11-14T12:19:52Z phoe Michał "phoe" Herda [email protected]

Thanks for the review and merge.

tag:gitlab.com,2020-11-13:988752663 Michał &quot;phoe&quot; Herda opened merge request !233: Fix GET-PROTOCOL-BY-NAME with unknown protocols at Embeddable Common-Lisp / ECL 2020-11-13T18:46:56Z phoe Michał "phoe" Herda [email protected]

The function SB-BSD-SOCKETS:GET-PROTOCOL-BY-NAME did not signal an error when it was unable to find a protocol. This is fixed now and an error of type UNKNOWN-PROTOCOL, with an accessor named UNKNOWN-PROTOCOL-NAME, is being signaled. These two names are also exported from the package SB-BSD-SOCKETS.

A test case is added.

Several other test cases are fixed with regard to :NO-ERROR clauses inside HANDLER-CASEs.

tag:gitlab.com,2020-11-13:988751110 Michał &quot;phoe&quot; Herda pushed to project branch develop at Michał &quot;phoe&quot; Herda / ECL 2020-11-13T18:45:21Z phoe Michał "phoe" Herda [email protected]

Michał "phoe" Herda (bb40da9f) at 13 Nov 18:45

Fix GET-PROTOCOL-BY-NAME with unknown protocols

tag:gitlab.com,2020-11-13:988706480 Michał &quot;phoe&quot; Herda created project Michał &quot;phoe&quot; Herda / ECL 2020-11-13T18:02:48Z phoe Michał "phoe" Herda [email protected] tag:gitlab.com,2020-07-06:817227663 Michał &quot;phoe&quot; Herda commented on issue #17 at eql / EQL5-Android 2020-07-06T11:28:35Z phoe Michał "phoe" Herda [email protected]

MOP is a complicated beast, so no worries about that - perhaps someone else will be able to contribute an functional equivalent to the above.

ENSURE-GENERIC-FUNCTION is the functional variant of DEFGENERIC, so it's the easier part; DEFMETHOD has no direct functional variant, but it is possible to make an instance of the STANDARD-METHOD class and then ADD-METHOD it to the generic function.

tag:gitlab.com,2020-07-06:817209378 Michał &quot;phoe&quot; Herda opened issue #17: &quot;no way to avoid EVAL here&quot; versus the MOP at eql / EQL5-Android 2020-07-06T11:14:42Z phoe Michał "phoe" Herda [email protected]

https://gitlab.com/eql/EQL5-Android/-/blob/master/utils/EQL5-symbols.lisp#L956-959

          ;; no way to avoid EVAL here (excluding non-portable hacks)
          (eval `(defgeneric ,lisp-name (object &rest arguments)))
          (eval `(defmethod ,lisp-name ((object qt-object) &rest arguments)
                   (%qinvoke-method object :qt ,qt-name arguments))))))))

Have you considered using MOP mechanics instead? ENSURE-GENERIC-FUNCTION and ADD-METHOD over MAKE-INSTANCE 'STANDARD-METHOD should work without the use of the Lisp evaluator.

tag:gitlab.com,2020-06-30:810117145 Michał &quot;phoe&quot; Herda commented on merge request !3 at clisp / clisp 2020-06-30T08:16:05Z phoe Michał "phoe" Herda [email protected]

What else is required to merge this upstream and make a new release?