unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* complex data structure in elisp
@ 2009-08-25 14:22 Dirk80
  2009-08-25 22:44 ` Bernardo
  0 siblings, 1 reply; 5+ messages in thread
From: Dirk80 @ 2009-08-25 14:22 UTC (permalink / raw)
  To: Help-gnu-emacs


Hi,

sorry for this beginner question. But I'm very interested how you would
represent the data structure of my example in elisp.

Here my example:
I want to implement a vocabulary trainer in elisp.

I have units. A unit is consisting of lessons and lessons are consistng of
sublessons. One sublesson is consisting of vocabularies. A vocabulary is
consisting of an audio-file, picture file and a text.

Here how I would do it in C:

struct Vocabulary
{
    char audio_file[255];
    char picture_file[255];
    char text[1000];
};

struct SubLesson
{
    int nb_vocabularies;
    struct Vocabulary[1000];
};

struct Lesson
{
    int nb_sub_lessons;
    struct SubLesson sub_lessons[10];
};

struct Unit
{
    int nb_lessons;
    struct Lesson lessons[10];
};

struct UnitList
{
    int nb_units;
    struct Unit units[8];
};

e.g. Unit 4, Lesson 7, Sublesson 2, Vocabulary 1, audio-file
struct UnitList unit_list;
unit_list.units[3].lessons[6].sub_lessons[1].vocabulary[0].audio_file =
"hello.wav";

Now to the details of using. Because I think this is important in elisp
because of performance.
This "UnitList" shall be initialised with content. During runtime it will
never be changed. 

Thank you a lot in advance for your help
Dirk

-- 
View this message in context: http://www.nabble.com/complex-data-structure-in-elisp-tp25135295p25135295.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-08-25 22:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.5305.1251210181.2239.help-gnu-emacs@gnu.org>
2009-08-25 14:45 ` complex data structure in elisp Joost Kremers
2009-08-25 15:06 ` Xah Lee
2009-08-25 16:01 ` Michael Ekstrand
2009-08-25 14:22 Dirk80
2009-08-25 22:44 ` Bernardo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).