From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: rusi Newsgroups: gmane.emacs.help Subject: need help debugging edebug (Common lisp problem?) Date: Mon, 13 Dec 2010 22:00:57 -0800 (PST) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1292308868 9956 80.91.229.12 (14 Dec 2010 06:41:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 14 Dec 2010 06:41:08 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 14 07:41:04 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PSOZL-0007Gb-Ct for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Dec 2010 07:41:03 +0100 Original-Received: from localhost ([127.0.0.1]:35033 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSOZJ-00061j-Vz for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Dec 2010 01:41:02 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!o23g2000prh.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 76 Original-NNTP-Posting-Host: 116.73.35.230 Original-X-Trace: posting.google.com 1292306459 15461 127.0.0.1 (14 Dec 2010 06:00:59 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 14 Dec 2010 06:00:59 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: o23g2000prh.googlegroups.com; posting-host=116.73.35.230; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:183234 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:77480 Archived-At: The following function (from http://delysid.org/emacs/midi.el ) crashes edebug. It gives edebug-syntax-error: Invalid read syntax: "Failed matching", ([&optional ["named" symbolp]] [&rest &or ["repeat" form] loop-for-as loop-with loop-initial-final] [&rest loop-clause]) Note: It loads correctly (or rather silently) if edebug is turned off I have a feeling its in the loop (cl) macro. Can someone who knows CL better have a look? (defun smf-read-mtrk (length) "Read one MTrk chunk. NoteOn/NoteOff and NoteOn/NoteOn(vel=0) event pairs are unified into a Note event with a certain duration." (let ((end (+ (point) length)) (notes (make-vector 16 nil)) (ticks 0) (running-status 0)) (dotimes (i 16) (aset notes i (make-vector 128 nil))) (loop while (< (point) end) do (incf ticks (smf-read-varlen)) for event = (let ((status (following-char))) (if (/= (logand status #B10000000 ) #B10000000 ) (if (= running-status 0) (error "Seen data byte without running status") (setq status running-status)) (forward-char 1)) (unless (= status #XFF ) (setq running-status status)) (let ((lower (logand status #X0F ))) (case (ash status -4) (8 (let* ((note (smf-read-byte)) (vel (smf-read-byte)) (old-note (aref (aref notes lower) note))) (if (not old-note) (list 'NoteOff lower note vel) (setcar (cdr old-note) 'Note) (setcdr (nthcdr 4 old-note) (list (- ticks (car old-note)) vel)) (aset (aref notes lower) note nil)))) (9 (let* ((note (smf-read-byte)) (vel (smf-read-byte)) (data (cons ticks (list 'NoteOn lower note vel)))) (if (= vel 0) (let ((old-note (aref (aref notes lower) note))) (if (not old-note) (cdr data) (setcar (cdr old-note) 'Note) (setcdr (nthcdr 4 old-note) (list (- ticks (car old-note)))) (aset (aref notes lower) note nil))) (cdr (aset (aref notes lower) note data))))) (10 (list 'At lower (smf-read-byte) (smf-read-byte))) (11 (list 'CC lower (smf-read-byte) (smf-read-byte))) (12 (list 'PC lower (smf-read-byte))) (13 (list 'CP lower (smf-read-byte))) (14 (list 'PW lower (logior (smf-read-byte) (lsh (smf-read-byte) 7)))) (15 (case lower (0 (append (list 'SysEx) (loop repeat (smf-read-varlen) collect (smf-read-byte)))) (2 (let ((value (logior (smf-read-byte) (lsh (smf-read-byte) 7)))) (list 'SongPosition value))) (3 (list 'SongSelect (smf-read-byte))) (6 (list 'TuneRequest)) (8 (list 'Clock)) (9 (list 'Tick)) (10 (list 'Start)) (11 (list 'Continue)) (12 (list 'Stop)) (14 (list 'ActiveSense)) (15 (smf-read-meta-event)) (t (error "Unknown stuff"))))))) until (eq event t) when event collect (cons ticks event))))