emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fadr


From: Thien-Thi Nguyen
Subject: Re: fadr
Date: Tue, 23 Jun 2009 11:14:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

() Dmitry Dzhus <address@hidden>
() Mon, 22 Jun 2009 23:56:27 +0400

   [...] I'm pleasantly surprised to see that `bindat-get-field` works
   with such tree (and others I have) like charm.

Cool.

   Moreover, it looks like I don't even need to tweak anything, as
   `bindat-get-field` is exactly what I was meant to write instead of
   `fadr-member`. Its docstring mentions the same C-style dotted
   notation I had in mind while writing fadr.

As we walk from root to leaf, ...

   The difference between these two is [...]
   So `fadr-member` is just a reinvented wheel at all.
   I'm going to drop it.

... may our steps synch regardless of shoe size.

   > Insert Perlis quote re strings, here....

   So what really makes «stark» strings non-lispy (apart from having a
   font-lock color which differs from that of symbols and parenthesis)?

I believe Perlis was saying all strings are stark.  In some cases i would
disagree, but maybe because i'm weird.

   Sometimes I need to access several different leaves of my tree in the
   same line, so I wrote `fadr-expand` which works as follows:

       (fadr-expand "Thread ~.threads[0].id has name ~.threads[0].target-id" 
threads)
       =>
       "Thread 1 has name LWP18334"

   A more realistic example from my code:

       (fadr-format "~.id (~.target-id) ~.state in ~.frame.func " thread)
       =>
       "1 (LWP18334) stopped in mult_matrices_mt "

   I coded this function to save some typing. Now I'm in doubts about
   whether it follows the spirit of Lisp.

When you want to collect several leaves, collect first their common branch,
then proceed from there.  This is a missing feature from bindat.el:

 (bindat-get-fields STRUCT BRANCH-SPEC LEAF-SPECS)
 => multiple values (or what have you);
    either: all leaves
        or: branch, plus all leaves

Would you like to add it?

thi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]