From: "Yoshinori K. Okuji" <okuji@enbug.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: some design issues
Date: Wed, 16 Feb 2005 22:07:46 +0100 [thread overview]
Message-ID: <200502162207.47056.okuji@enbug.org> (raw)
In-Reply-To: <42136E4D.9090709@list.ru>
On Wednesday 16 February 2005 17:01, Serbinenko Vladimir wrote:
> In my scripting engine entry is parsed the same way that function.
> Only difference is where contents stored but it's not written as a
> normal function because it changes a bit the way the input parsed (no
> expanding, ...) What do you think about it?
You can treat commands between braces as a group. In bash, a function is
defined in the following way:
foo() {
...
}
Or:
function foo {
...
}
In both cases, the contents enclosed with braces are not evaluated but
defined as the body of the function `foo'.
For me, the command `entry' is a kind of shell function. The difference
between an entry and a function is that an entry is a part of a menu,
while a function is a command. In other words, an entry is an anonymous
function which is assigned to a slot in a menu.
So I think a clean way is to pass such a group as a single argument. For
example, if the user specifies this:
entry "foo" { kernel /boot/vmlinuz; initrd /boot/initrd }
your parser would invoke grub_cmd_entry with the arguments "foo" and
"kernel /boot/vmlinuz; initrd /boot/initd".
If the user specifies this:
function foo { kernel /boot/vmlinuz; initrd /boot/initrd }
it would invoke grub_cmd_function with the argument "foo" and
"kernel /boot/vmlinuz; initrd /boot/initd".
This looks consistent to me.
Okuji
next prev parent reply other threads:[~2005-02-16 21:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-14 21:25 some design issues Yoshinori K. Okuji
2005-02-15 6:14 ` Paul
2005-02-15 16:24 ` Hollis Blanchard
2005-02-15 22:15 ` Yoshinori K. Okuji
2005-02-15 19:41 ` Marco Gerards
2005-02-15 22:17 ` Yoshinori K. Okuji
2005-02-16 18:05 ` Marco Gerards
2005-02-16 20:49 ` Yoshinori K. Okuji
2005-02-15 20:24 ` Vincent Pelletier
2005-02-15 22:23 ` Yoshinori K. Okuji
2005-02-16 16:01 ` Serbinenko Vladimir
2005-02-16 21:07 ` Yoshinori K. Okuji [this message]
2005-02-17 16:03 ` Serbinenko Vladimir
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=200502162207.47056.okuji@enbug.org \
--to=okuji@enbug.org \
--cc=grub-devel@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.
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.