[prev in list] [next in list] [prev in thread] [next in thread] 

List:       grub-devel
Subject:    Re: [PATCH] Allow user-defined functions to override builtins.
From:       Michel Hermier <michel.hermier () gmail ! com>
Date:       2014-05-25 9:08:28
Message-ID: CAAZ5spCo3taRXz7ry_aKz9YQdE+2pP+0PtaqmbwEEkUAkmCwEg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Le 22 mai 2014 09:32, "Vladimir '=CF=86-coder/phcoder' Serbinenko" <
phcoder@gmail.com> a =C3=A9crit :
>
> On 19.05.2014 08:37, Glenn Washburn wrote:
> > Currently, builtin commands take precedence over user-defined
> > functions.  This patch reverses that precedence, so that users can
> > "override" builtin commands.  Builtin commands may be accessed by
> > issuing the command prefixed by an '@' character.
> >
> Overriding builtins sounds like a bad idea. For once it creates a
> language which is heavily dependent on context. This gets hairy and
> messy very fast.
This probably true, but it add 2 great values for me.
One can add tracing/debugging for cheap even on generated/3 party scripts,
as afaik grub don't offer a tracing mode, this can be even more hairy.
One can emulate some extra funtionnality on older version to some point,
without the need to make custom wrappers, and requiring to hack 3rd party
scripts.
So it's true one can mess, and make the things dependant of context, and
maybe not all builtin should be overwritable, but when one feel the need to
override a builtin, he usually have good reason to do it, even if it can be
done in other ways.
> > My motivation for this change is to hook insmod in loaded configfiles
> > which set $prefix to a different location than desired.  If there are
> > any changes needed to help get this functionality included, please let
> > me know.
> >
> Could you detail your usercase more? $prefix is the location where
> modules are, why not just set it to right location?
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>

[Attachment #5 (text/html)]

<p dir="ltr"><br>
Le 22 mai 2014 09:32, &quot;Vladimir &#39;φ-coder/phcoder&#39; Serbinenko&quot; \
&lt;<a href="mailto:phcoder@gmail.com">phcoder@gmail.com</a>&gt; a écrit :<br> \
&gt;<br> &gt; On 19.05.2014 08:37, Glenn Washburn wrote:<br>
&gt; &gt; Currently, builtin commands take precedence over user-defined<br>
&gt; &gt; functions.   This patch reverses that precedence, so that users can<br>
&gt; &gt; &quot;override&quot; builtin commands.   Builtin commands may be accessed \
by<br> &gt; &gt; issuing the command prefixed by an &#39;@&#39; character.<br>
&gt; &gt;<br>
&gt; Overriding builtins sounds like a bad idea. For once it creates a<br>
&gt; language which is heavily dependent on context. This gets hairy and<br>
&gt; messy very fast.<br>
This probably true, but it add 2 great values for me.<br>
One can add tracing/debugging for cheap even on generated/3 party scripts, as afaik \
grub don&#39;t offer a tracing mode, this can be even more hairy.<br> One can emulate \
some extra funtionnality on older version to some point, without the need to make \
custom wrappers, and requiring to hack 3rd party scripts.<br> So it&#39;s true one \
can mess, and make the things dependant of context, and maybe not all builtin should \
be overwritable, but when one feel the need to override a builtin, he usually have \
good reason to do it, even if it can be done in other ways.<br>

&gt; &gt; My motivation for this change is to hook insmod in loaded configfiles<br>
&gt; &gt; which set $prefix to a different location than desired.   If there are<br>
&gt; &gt; any changes needed to help get this functionality included, please let<br>
&gt; &gt; me know.<br>
&gt; &gt;<br>
&gt; Could you detail your usercase more? $prefix is the location where<br>
&gt; modules are, why not just set it to right location?<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Grub-devel mailing list<br>
&gt; <a href="mailto:Grub-devel@gnu.org">Grub-devel@gnu.org</a><br>
&gt; <a href="https://lists.gnu.org/mailman/listinfo/grub-devel">https://lists.gnu.org/mailman/listinfo/grub-devel</a><br>
 &gt;<br>
</p>



_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic