octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: demo syntax and using dump_demos to compare to ML


From: Søren Hauberg
Subject: Re: demo syntax and using dump_demos to compare to ML
Date: Sun, 22 Jan 2012 20:38:59 +0100

søn, 22 01 2012 kl. 14:29 -0500, skrev Ben Abbott:
> On Jan 22, 2012, at 2:11 PM, Søren Hauberg wrote:
> 
> > søn, 22 01 2012 kl. 14:02 -0500, skrev Ben Abbott:
> > 
> >> After that I'd like to add these to the sources. I'm thinking these
> >> can be added to scripts/test, but an not sure if they should be listed
> >> in module.mk. I've cc'd Soren, Jordi, and John in case they would like
> >> to comment before I do something that may need to be undone.
> >> 
> >> Thoughts / Suggestions ?
> > 
> > Glad to see this being put to use; I think it's a good way to test the
> > plotting system.
> > 
> > I seem to remember that the dump_demos script had some ad hoc rules for
> > converting from Octave syntax to something Matlab compatible. I think
> > this is something we need to be very careful about, so if that code
> > still exists I would consider removing it.
> > 
> > Søren
> 
> 
> The dump_demos.m script does include a simplisitc oct2mat() function.
> 
> function code = oct2mat (code)
>   ## Simple hacks to make things Matlab compatible
>   code = strrep (code, "%!", "%%");
>   code = strrep (code, "!", "~");
>   code = strrep (code, "\"", "'");
>   code = strrep (code, "#", "%");
>   ## Fix the format specs for the errobar demos
>   code = strrep (code, "%r", "#r");
>   code = strrep (code, "%~", "#~");
>   code = strrep (code, "assert", "assert4demos");
>   endkeywords = {"endfor", "endif", "endwhile", "end_try_catch", 
> "endfunction"};
>   for k = 1:numel (endkeywords)
>     in = endkeywords {k};
>     out = in; out (4:end) = " ";
>     code = strrep (code, in, out);
>   endfor
>   commentkeywords = {"unwind_proect"};
>   for k = 1:numel (commentkeywords)
>     code = strrep (code, commentkeywords{k}, strcat ("%", 
> commentkeywords{k}));
>   endfor
> endfunction
> 
> Are  you implying there may be a legal liability related to this ? Or, 
> something else ?

No I am just thinking that this type of code will easily break, so I
would be afraid of depending upon it.

Søren



reply via email to

[Prev in Thread] Current Thread [Next in Thread]