Brice Waegeneire schreef op zo 01-08-2021 om 22:59 [+0200]: > ice-9/boot-9.scm:1685:16: In procedure raise-exception: > In procedure package-name: Wrong type argument: # > --8<---------------cut here---------------end--------------->8--- > > > If we want to go further, we’ll have to end up with GOOPS… > > [...] > > Building a parent class of and looks really > involved to just fix this issue. Is there another way, or are we forced to > use GOOPS in that case? Going full GOOPS isn't necessary. Something like 'define-gexp-compiler' could be useful here, to make 'package-inputs' and the like support inferior packages. More specifically, something like this: ;; In (guix packages) (define %inputs-hashtable (make-hash-table 2)) (define (package-inputs package) ;; Fast path: package is actually a (if (eq? (struct-vtable package) ) (%package-inputs package) ; expects a ((hashq-ref %inputs-hashtable (struct-vtable package)) package))) ;; In (guix inferior): (hashq-set! %inputs-hashtable %inferior-package-inputs) and likewise for native-inputs, propagated-inputs, name, version, ... (some macroology is recommended). Or, simpler, but less extensible (but probably good enough): (define-module (guix packages) [...] #:autoload (guix inferior) (inferior-package-inputs [...])) [...] (define (package-inputs package) (cond ((package? package) (%package-inputs package)) ((inferior-package? package) (inferior-package-inputs package)) (#t (error (G_ "tried to use 'package-inputs' on a non-package object ~a") package)))) The idea of both suggestions is to let 'package-name', 'package-native-inputs', ... work on both regular and objects. Greetings, Maxime.