| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#21
| |||
| |||
| Geshundteit. |
|
#22
| |||
| |||
| Hmm, I noticed that I didn't explain one detail rather explicitly. I planned to _join_ Symbolicweb development. So, there was a large amount of code already at the moment I tried to introduce an iterate. It is a significant circumstance and may be this was a main reason of misunderstanding. |
|
#23
| |||
| |||
| Я тебя не понял |
|
#24
| |||
| |||
| On 2008-11-05, budden <budden01@mtu-net.ru> wrote: > And (as I wrote before, now repeating), iterate exports too many > symbols with very general names. Iterate's interface is badly designed. It should use keywords for its clauses, or else follow the LOOP design so that symbols from any package whatsoever will match the clause identifiers using string equality. |
|
#25
| |||
| |||
| On 2008-11-05, Tamas K Papp <tkpapp@gmail.com> wrote: > On Wed, 05 Nov 2008 09:07:40 -0800, budden wrote: > >> And, again, no one answers the questions I ask. > > That should be a clue. He has a point in that if you're using some package that defines a COLLECTING symbol, oft-used in your code, then using iterate's COLLECTING throughout the same codebase will be a pain in the butt. Looking at the iterate source, it appears it would be very easy to hack it to provide keyword synonyms for all of the clauses, allowing for :COLLECTING to be used instead of ITERATE:COLLECTING. |
|
#26
| |||
| |||
| On Wed, 05 Nov 2008 19:51:10 +0000, Kaz Kylheku wrote: > On 2008-11-05, Tamas K Papp <tkpapp@gmail.com> wrote: >> On Wed, 05 Nov 2008 09:07:40 -0800, budden wrote: >> >>> And, again, no one answers the questions I ask. >> >> That should be a clue. > > He has a point in that if you're using some package that defines a > COLLECTING symbol, oft-used in your code, then using iterate's > COLLECTING throughout the same codebase will be a pain in the butt. My impression was that he is not trying to modify iterate, but overhaul the Lisp package mechanism because of minor difficulties he encountered using iterate. Certainly an interesting approach. > Looking at the iterate source, it appears it would be very easy to hack > it to provide keyword synonyms for all of the clauses, allowing for > :COLLECTING to be used instead of ITERATE:COLLECTING. You can already use keywords everywhere else but the clause name, eg (iter (for i :from 2 :to 5) (summing i)) I always do this, at it also plays nice with Emacs's syntax highlighting. A modification of iterate which only used keywords would be nice. So why doesn't budden fix that instead of redesigning CL? Tamas |
|
#27
| |||
| |||
| Greetings, Kaz! You seem to be the second person after Lars who understood me. And I found one analogy in addition to loop. Why does cl-who suggests (:a (:href ...)) instead of (a (href ...))? It is due to the same clearness of that: you'll never get symbol conflicts, your html pseudocode looks just the same in any package. This is the same thing that I have already done to iterate. >*So why doesn't budden fix that instead of redesigning CL? Hmmm is my English really so poor? I have this done already and I reported this fact three of for times in the topic. Or is this a prejudice? Didn't tested, but (iter (:for i :from 1 :to 10) (:collect i)) works on a Lispworks personal for windows and on an sbcl 1.0.20. Some more iterate constructs worked too. Iterate was loaded with asdf- install/asdf in both cases. Original file iterate.lisp has version 1.4.3. I took a more look at a source now. I found I use what actually is a named function in an iterate and it is called keywordize. Maybe what I did is not that correct and a simple approach is possible. But that is enough for me. Maybe someone more smarter would do it. >>>>>>>>>>>>>>>>>>>patch follows *** iterate-orig.lisp 2008-11-06 00:41:31.000000000 +0300 --- iterate.lisp 2008-11-06 01:11:42.000000000 +0300 *************** *** 797,807 **** ;; example. Plus, we want to catch Iterate special clauses. (assoc symbol *special-form-alist*)) (defun walk-special-form (form) (let ((*clause* form) ! (func (cdr (assoc (car form) *special-form-alist*)))) (if (null func) ; there's nothing to transform (list form) (apply func form)))) #+nil --- 797,810 ---- ;; example. Plus, we want to catch Iterate special clauses. (assoc symbol *special-form-alist*)) (defun walk-special-form (form) (let ((*clause* form) ! (func (cdr (assoc (if (keywordp (car form)) ! (find-symbol (string (car form)) :iterate) ! (car form)) ! *special-form-alist*)))) (if (null func) ; there's nothing to transform (list form) (apply func form)))) #+nil *************** *** 1027,1036 **** --- 1030,1040 ---- (t (clause-error "No iterate function for this clause; do ~ (~S) to see the existing clauses." 'display-iterate-clauses))))))) (defun apply-clause-function (func args) + (when (keywordp func) (setf func (find-symbol (string func) :iterate))) (let ((*initial* nil) (*decls* nil) (*step* nil) (*final* nil) (*finalp* nil)) *************** *** 2296,2305 **** --- 2300,2315 ---- ,(if (stringp (car body)) (car body))))) (defun install-special-clause-function (symbol &optional doc-string) ;; Put it at the end, if not already present. + (let* ((key-symbol (intern (string symbol) :keyword)) + (entry (assoc key-symbol *special-clause-alist*))) + (if (null entry) + (augment *special-clause-alist* (list (cons key-symbol doc- string))) + (setf (cdr entry) doc-string)) + symbol) (let ((entry (assoc symbol *special-clause-alist*))) (if (null entry) (augment *special-clause-alist* (list (cons symbol doc-string))) (setf (cdr entry) doc-string)) symbol)) *************** *** 3577,3586 **** --- 3587,3601 ---- (defmacro me (x) `(progn (setq *print-pretty* t) (macroexpand-1 ',x))) |# + (eval-when (:load-toplevel :execute) + (dolist (x (cdr *clause-info-index*)) + (let ((i (car x))) + (eval `(defsynonym ,(intern (string i) :keyword) ,i))))) + (eval-when (:compile-toplevel :load-toplevel :execute) (when (and (boundp '*old-sharpL-func*) *old-sharpL-func*) (set-dispatch-macro-character #\# #\L *old-sharpL-func*))) >>>>>>>>>>>>>>>>>>>patch ended here |
|
#28
| |||
| |||
| George Neuner wrote: > Geshundteit. I don't think you noticed the time of the post. hth,kenny |
|
#29
| |||
| |||
| On Wed, 05 Nov 2008 19:47:21 -0500, Kenny <kentilton@gmail.com> wrote: >George Neuner wrote: >> Geshundteit. > >I don't think you noticed the time of the post. > >hth,kenny I saw it. You say your bedtime prayers online? George |
|
#30
| |||
| |||
| George Neuner wrote: > On Wed, 05 Nov 2008 19:47:21 -0500, Kenny <kentilton@gmail.com> wrote: > > >>George Neuner wrote: >> >>>Geshundteit. >> >>I don't think you noticed the time of the post. >> >>hth,kenny > > > I saw it. You say your bedtime prayers online? Who could go to bed at a time like...oh, my. Don't tell me you slept thru it. kt |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.