* What I do and what happens:
(setf (find-class 'my-string-class) (find-class 'cl:string))
(make-sequence 'my-string-class 3 :initial-element #\.) ;error :string is too hairy for sequence functions.
(concatenate 'my-string-class "foo" "bar") ;error :string is too hairy for sequence functions.
(concatenate '(my-string-class 6) "foo" "bar") ;error :string is too hairy for sequence functions.
* What I expected to happen:
(concatenate 'my-string-class "foo" "bar") ;=> "foobar"
(concatenate '(my-string-class 6) "foo" "bar") ;=> "foobar"
* See also:
(deftype my-string-type (&rest args) `(cl:string ,@args))
(make-sequence 'my-string-type 3 :initial-element #\.) ;=> "..."
(concatenate 'my-string-type "foo" "bar") ;=> "foobar"
(concatenate '(my-string-type 6) "foo" "bar") ;=> "foobar"
* Analysis:
CL:MAKE-SEQUENCE adjusted-type'ed type-specifier with SB-EXT:TYPEXPAND, but it should be expanded recursively with SB-EXT::TYPEXPAND-ALL etc.
((eq expanded-type 'string) '(vector character)) ==> ((eq (typexpand-all expanded-type) 'string) '(vector character))
etc.
Environment: SBCL 1.2.12
uname -a: Linux t 4.1.0-rc6-t #1 SMP PREEMPT Wed Jun 3 06:48:43 JST 2015 x86_64 GNU/Linux
*features*: (:sbcl-uses-sb-rotate-byte :generic-sequences :cl-unicode :newline-is-linefeed :has-vt :has-bell :has-escape :has-linefeed :has-return :has-backspace :has-tab :has-page :has-rubout :declare-types :esrap.can-handle-left-recursion :esrap.multiple-transforms :esrap.function-terminals :esrap.expression-start-terminals mopp::have-mop :cl-json-clos :cl-json :arc-compat :asdf-system-connections :5am :kmr-mop :rune-is-character :named-readtables :hunchentoot :sbcl-debug-print-variable-alist :cl-fad :bordeaux-threads cffi-features:flat-namespace cffi-features:x86-64 cffi-features:unix :cffi cffi-sys::flat-namespace :cl-ppcre :flexi-streams :chunga :split-sequence :closer-mop :thread-support chipz-system:gray-streams :swank :quicklisp :sb-bsd-sockets-addrinfo :asdf-package-system :asdf3.1 :asdf3 :asdf2 :asdf :os-unix :non-base-chars-exist-p :asdf-unicode :alien-callbacks :ansi-cl :ash-right-vops :c-stack-is-control-stack :common-lisp :compare-and-swap-vops :complex-float-vops :cycle-counter :elf :float-eql-vops :gencgc :ieee-floating-point :inline-constants :integer-eql-vop :interleaved-raw-slots :largefile :linkage-table :linux :little-endian :memory-barrier-vops :multiply-high-vops :os-provides-blksize-t :os-provides-dladdr :os-provides-dlopen :os-provides-getprotoby-r :os-provides-poll :os-provides-putwc :os-provides-suseconds-t :package-local-nicknames :precise-arg-count-error :raw-instance-init-vops :sb-after-xc-core :sb-core-compression :sb-doc :sb-eval :sb-futex :sb-ldb :sb-package-locks :sb-simd-pack :sb-source-locations :sb-test :sb-thread :sb-unicode :sb-xref-for-internals :sbcl :stack-allocatable-closures :stack-allocatable-fixed-objects :stack-allocatable-lists :stack-allocatable-vectors :stack-grows-downward-not-upward :symbol-info-vops :unix :unwind-to-frame-and-call-vop :x86-64)
* What I do and what happens:
(setf (find-class 'my-string-class)
(find-class 'cl:string))
(make-sequence 'my-string-class 3 :initial-element #\.)
;error :string is too hairy for sequence functions.
(concatenate 'my-string-class "foo" "bar")
;error :string is too hairy for sequence functions.
(concatenate '(my-string-class 6) "foo" "bar")
;error :string is too hairy for sequence functions.
* What I expected to happen:
(concatenate 'my-string-class "foo" "bar")
;=> "foobar"
(concatenate '(my-string-class 6) "foo" "bar")
;=> "foobar"
* See also:
(deftype my-string-type (&rest args)
`(cl:string ,@args))
(make-sequence 'my-string-type 3 :initial-element #\.)
;=> "..."
(concatenate 'my-string-type "foo" "bar")
;=> "foobar"
(concatenate '(my-string-type 6) "foo" "bar")
;=> "foobar"
* Analysis:
CL:MAKE-SEQUENCE adjusted-type'ed type-specifier with SB-EXT:TYPEXPAND, but it should be expanded recursively with SB-EXT: :TYPEXPAND- ALL etc.
((eq expanded-type 'string) '(vector character))
==>
((eq (typexpand-all expanded-type) 'string) '(vector character))
etc.
Environment:
SBCL 1.2.12
uname -a:
Linux t 4.1.0-rc6-t #1 SMP PREEMPT Wed Jun 3 06:48:43 JST 2015 x86_64 GNU/Linux
*features*: uses-sb- rotate- byte :generic-sequences :cl-unicode :newline- is-linefeed can-handle- left-recursion multiple- transforms :esrap. function- terminals expression- start-terminals mopp::have-mop :cl-json-clos :cl-json connections :5am :kmr-mop :rune-is-character print-variable- alist :cl-fad flat-namespace cffi-features: x86-64 :flat-namespace :cl-ppcre :flexi-streams gray-streams sockets- addrinfo :asdf-package- system :asdf3.1 chars-exist- p :asdf-unicode is-control- stack and-swap- vops :complex-float-vops :cycle-counter :elf point :inline-constants raw-slots :largefile :linkage-table :linux barrier- vops :multiply-high-vops :os-provides- blksize- t dladdr :os-provides-dlopen :os-provides- getprotoby- r suseconds- t local-nicknames :precise- arg-count- error :raw-instance- init-vops compression :sb-doc :sb-eval :sb-futex :sb-ldb locations :sb-test :sb-thread for-internals :sbcl :stack- allocatable- closures allocatable- fixed-objects :stack- allocatable- lists allocatable- vectors :stack- grows-downward- not-upward :symbol-info-vops to-frame- and-call- vop :x86-64)
(:sbcl-
:has-vt :has-bell :has-escape :has-linefeed :has-return :has-backspace
:has-tab :has-page :has-rubout :declare-types :esrap.
:esrap.
:esrap.
:arc-compat :asdf-system-
:named-readtables :hunchentoot :sbcl-debug-
:bordeaux-threads cffi-features:
cffi-features:unix :cffi cffi-sys:
:chunga :split-sequence :closer-mop :thread-support chipz-system:
:swank :quicklisp :sb-bsd-
:asdf3 :asdf2 :asdf :os-unix :non-base-
:alien-callbacks :ansi-cl :ash-right-vops :c-stack-
:common-lisp :compare-
:float-eql-vops :gencgc :ieee-floating-
:integer-eql-vop :interleaved-
:little-endian :memory-
:os-provides-
:os-provides-poll :os-provides-putwc :os-provides-
:package-
:sb-after-xc-core :sb-core-
:sb-package-locks :sb-simd-pack :sb-source-
:sb-unicode :sb-xref-
:stack-
:stack-
:unix :unwind-