Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1D1WcF-0003xq-Ug for mharc-grub-devel@gnu.org; Wed, 16 Feb 2005 16:21:49 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D1WcC-0003ws-QV for grub-devel@gnu.org; Wed, 16 Feb 2005 16:21:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D1WcA-0003vm-An for grub-devel@gnu.org; Wed, 16 Feb 2005 16:21:43 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D1WcA-0003uE-5v for grub-devel@gnu.org; Wed, 16 Feb 2005 16:21:42 -0500 Received: from [212.43.237.68] (helo=kotoba.storever.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1D1WNX-0002jl-NR for grub-devel@gnu.org; Wed, 16 Feb 2005 16:06:35 -0500 Received: from ASSP-nospam (localhost [127.0.0.1]) by kotoba.storever.com (Postfix) with ESMTP id 06E70FEA852F for ; Wed, 16 Feb 2005 22:06:35 +0100 (CET) Received: from 127.0.0.1 ([127.0.0.1] helo=localhost) by ASSP-nospam ; 16 Feb 05 21:06:34 -0000 From: "Yoshinori K. Okuji" Organization: enbug.org To: The development of GRUB 2 Date: Wed, 16 Feb 2005 22:07:46 +0100 User-Agent: KMail/1.7.1 References: <200502142225.36773.okuji@enbug.org> <200502152323.09524.okuji@enbug.org> <42136E4D.9090709@list.ru> In-Reply-To: <42136E4D.9090709@list.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200502162207.47056.okuji@enbug.org> Subject: Re: some design issues X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2005 21:21:45 -0000 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