From mbaehr at email.archlab.tuwien.ac.at Fri Nov 23 02:46:34 2012 From: mbaehr at email.archlab.tuwien.ac.at (Martin =?iso-8859-1?Q?B=E4hr?=) Date: Fri, 23 Nov 2012 03:46:34 +0100 Subject: [linedit-devel] type error with tab completion Message-ID: <20121123024634.GU3152@email.archlab.tuwien.ac.at> hi, using my own completer function i get a type error in sbcl or ccl: (defun complete (key all) (let ((match nil)) (setf match (loop for word in all when (equal (mismatch key word :test #'string-equal) (length key)) collect word)) (values match (length match)))) (defun tag-completer (key editor) (complete key (mapcar #'symbol-name '(CURRENT RESEARCH TEST WEEK-24 WEEK-25 WEEK-26 WRITEUP)))) (defun prompt-read (prompt &optional default &key complete) (linedit:linedit :prompt (concatenate 'string prompt ": ") :string (or default "") :complete (or complete (lambda (a b)())))) (prompt-read "test" "" :complete #'tag-completer) test: CURRENT RESEARCH TEST WEEK-24 WEEK-25 WEEK-26 WRITEUP test: w WEEK-24 debugger invoked on a TYPE-ERROR in thread #: The value -1 is not of type (MOD 536870909). Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL. restarts (invokable by number or by possibly-abbreviated name): 0: [ABORT] Exit debugger, returning to top level. ((FLET #:CLEANUP-FUN-25 :IN LINEDIT:LINEDIT))[:CLEANUP] 0] ccl reports > Error: value -1 is not of the expected type (UNSIGNED-BYTE 24). > While executing: LINEDIT:LINEDIT, in process listener(1). > Type :POP to abort, :R for a list of available restarts. > Type :? for other options. 1 > greetings, martin. -- cooperative communication with sTeam - caudium, pike, roxen and unix services: debugging, programming, training, linux sysadmin, web development -- pike programmer working in china societyserver.(org|net) foresight developer community.gotpike.org foresightlinux.org unix sysadmin (open-steam|www.caudium).org realss.com Martin B?hr http://societyserver.org/mbaehr/