• Re: Depth First Search traversal of this list

    From Caleh HellCat@21:1/5 to All on Sun Oct 1 16:36:57 2023
    On Friday, September 19, 2008 at 11:56:29 AM UTC-4, André Thieme wrote:
    William James schrieb:
    On Sep 12, 6:51 am, p...@informatimago.com (Pascal J. Bourguignon)
    wrote:
    William James <w_a_x_...@yahoo.com> writes:
    Ruby:
    If you want to keep writing Ruby in cll,

    I don't want to, but I feel that it is important
    to make the superiority of COMOL-LISP glaringly
    evident to all window-shoppers who read this group.

    This will be done simply by showing that Ruby code
    is always more prolix, more convoluted, less elegant,
    and less readable to a normal human than CLISP code.

    Admittedly, my attempts so far have been rather
    unsuccessful. I hope to improve with practice.
    To be successful you should show algorithms to solve the problem
    which can’t be expressed with the same ease in Lisp.
    In all of your examples you only made use of facilities which Ruby
    got from Lisp (like loops, blocks, injects, ...). Of course this can
    not impress anyone here, because all this stuff already is in Lisp.
    A Haskell fan can at least bring in implicit currying and pattern
    matching. This can of course also be done in Lisp, but at least such
    attempts make much more sense, because these techniques can indeed
    reduce program complexity.
    By saving three keystrokes with Rubys map vs Lisps mapcar no piece
    of software becomes easier to understand (nor can it be written faster
    in any meaningful way).
    As long you show only some functions calls, a bit imperative style here
    some funky functional style there you won’t be able to beat Lisp, as it
    can be done the same way. Bring in abstractions. Look at Haskell or
    Prolog or Mercury. They offer abstractions which are not always so
    very easy to implement in Lisp.

    André
    --
    Kenny was right #JusticeForKenny

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From B. Pym@21:1/5 to Kenny on Fri Aug 30 17:31:59 2024
    XPost: comp.lang.scheme

    Kenny wrote:

    (defun tv (x)
    (if (consp x)
    (loop for y in x do (tv y))
    (format t "~a " x)))

    Gauche Scheme

    (define (tv x)
    (if (pair? x) (for-each tv x) (format #t "~a " x)))

    (tv '(j k (l m (n o) p) q))


    j k l m n o p q

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)