From: Dirk80 <dirk@dirkundsari.de>
To: Help-gnu-emacs@gnu.org
Subject: complex data structure in elisp
Date: Tue, 25 Aug 2009 07:22:51 -0700 (PDT) [thread overview]
Message-ID: <25135295.post@talk.nabble.com> (raw)
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.
next reply other threads:[~2009-08-25 14:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-25 14:22 Dirk80 [this message]
2009-08-25 22:44 ` complex data structure in elisp Bernardo
[not found] <mailman.5305.1251210181.2239.help-gnu-emacs@gnu.org>
2009-08-25 14:45 ` Joost Kremers
2009-08-25 15:06 ` Xah Lee
2009-08-25 16:01 ` Michael Ekstrand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=25135295.post@talk.nabble.com \
--to=dirk@dirkundsari.de \
--cc=Help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.