Skip to content

Commit

Permalink
maint: Merge default to bytecode-interpreter
Browse files Browse the repository at this point in the history
  • Loading branch information
arungiridhar committed Jan 27, 2025
2 parents fced861 + bf95827 commit ce93562
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 11 deletions.
16 changes: 8 additions & 8 deletions libgui/languages/es_ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<message>
<location line="+6"/>
<source>Background color, magenta (255, 0, 255) means default</source>
<translation>Color de fondo; rosa (255,0,255) representa predeterminado</translation>
<translation>Color de fondo. Predeterminado a magenta (255,0,255)</translation>
</message>
<message>
<location line="+2"/>
Expand Down Expand Up @@ -224,13 +224,13 @@
<location line="-21"/>
<location filename="../graphics/ui-annotation-dialog.h" line="-3"/>
<source>Horizontal alignment</source>
<translation>Alineamiento horizontal</translation>
<translation>Alineación horizontal</translation>
</message>
<message>
<location line="+29"/>
<location filename="../graphics/ui-annotation-dialog.h" line="+5"/>
<source>Vertical alignment</source>
<translation>Alineamiento vertical</translation>
<translation>Alineación vertical</translation>
</message>
<message>
<location line="+11"/>
Expand Down Expand Up @@ -501,7 +501,7 @@ Sólo estará disponible la ayuda a través de la ventana de comandos.</translat
<source>
No documentation bookmarks loaded!</source>
<translation>
No se han cargado favoritos de documentación.</translation>
No se han cargado favoritos de documentación</translation>
</message>
<message>
<location line="+2"/>
Expand Down Expand Up @@ -3575,7 +3575,7 @@ esta actualmente en uso para la acción
<location line="+237"/>
<location filename="../src/ui-settings-dialog.h" line="+17"/>
<source>These preferences are applied after any .octaverc startup files.</source>
<translation>Estas configuraciones se aplicarán después de la carga del archivo de inicio .octaverc.</translation>
<translation>Estas configuraciones se aplicarán después de la carga de cualquier archivo de inicio .octaverc.</translation>
</message>
<message>
<location line="+353"/>
Expand Down Expand Up @@ -4008,7 +4008,7 @@ esta actualmente en uso para la acción
<location line="+13"/>
<location filename="../src/ui-settings-dialog.h" line="+1"/>
<source>Break lines only in comments</source>
<translation>Partir líneas solo en comentarios</translation>
<translation>Partir líneas sólo en comentarios</translation>
</message>
<message>
<location line="+60"/>
Expand Down Expand Up @@ -4170,7 +4170,7 @@ esta actualmente en uso para la acción
<location line="-253"/>
<location filename="../src/ui-settings-dialog.h" line="-14"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If set, the focus of the widgets that are docked to the main window follows the mouse cursor. This is intended for having the same behavior within the main window when &amp;quot;focus follows mouse&amp;quot; is used for the desktop environment.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Si se selecciona, el foco en los widgets anclados en la ventana principal se activa según la posición del ratón. Esto persigue un comportamiento igual al del entorno de escritorio..&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Si se selecciona, el foco en los widgets anclados en la ventana principal se activa según la posición del ratón. Esto persigue un comportamiento igual al del entorno de escritorio.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<location line="+3"/>
Expand Down Expand Up @@ -4334,7 +4334,7 @@ esta actualmente en uso para la acción
<location line="+78"/>
<location filename="../src/ui-settings-dialog.h" line="+3"/>
<source>Variable Editor Colors</source>
<translation>Colores de editor de variables</translation>
<translation>Colores del editor de variables</translation>
</message>
<message>
<location line="+12"/>
Expand Down
4 changes: 4 additions & 0 deletions libinterp/octave-value/ov-lazy-idx.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ class OCTINTERP_API octave_lazy_index : public octave_base_value
void print (std::ostream& os, bool pr_as_read_syntax = false)
{ make_value ().print (os, pr_as_read_syntax); }

std::string edit_display (const float_display_format& fmt,
octave_idx_type i, octave_idx_type j) const
{ return make_value ().edit_display (fmt, i, j); }

void print_info (std::ostream& os, const std::string& prefix) const
{ make_value ().print_info (os, prefix); }

Expand Down
62 changes: 59 additions & 3 deletions scripts/general/structfun.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,24 @@
error ("structfun: invalid options");
endif

varargout = cell (max ([nargout, 1]), 1);
[varargout{:}] = cellfun (fcn, struct2cell (S), varargin{:});
varargout_defined = true;

if (nargout == 0)
## ANS should not normally be defined here, but just in case someone
## changes the code above so that it could be...
clear ("ans");
cellfun (fcn, struct2cell (S), varargin{:});
if (exist ("ans", "var"))
varargout = {ans};
else
varargout_defined = false;
endif
else
varargout = cell (max ([nargout, 1]), 1);
[varargout{:}] = cellfun (fcn, struct2cell (S), varargin{:});
endif

if (! uniform_output)
if (! uniform_output && varargout_defined)
varargout = cellfun ("cell2struct", varargout, {fieldnames(S)}, {1}, ...
uo_str, false);
endif
Expand Down Expand Up @@ -148,3 +162,45 @@
%! [aa, bb] = structfun (@__twoouts, s, "UniformOutput", false);
%! assert (aa, c);
%! assert (bb, d);

%!function __zeroout(x)
%!endfunction;

%!test <66617>
%! s.a = 3;
%! clear ("ans");
%! structfun (@__zeroout, s);
%! assert (! exist ("ans", "var"));

%!test <66617>
%! s.a = 3;
%! clear ("ans");
%! structfun (@__zeroout, s, "UniformOutput", false);
%! assert (! exist ("ans", "var"));

%!test <66617>
%! s = struct ("a", 1, "b", 4);
%! clear ("ans");
%! structfun (@deal, s);
%! assert (! exist ("ans", "var"));

%!test
%! s = struct ("a", 1, "b", 4);
%! a = structfun (@deal, s);
%! assert (a, [1; 4]);

%!test
%! s = struct ("a", 1, "b", 4);
%! [a, b] = structfun (@deal, s);
%! assert ([a, b], [1, 1; 4, 4]);

%!test <66617>
%! s = struct ();
%! clear ("ans");
%! structfun (@(z) z, s);
%! assert (! exist ("ans", "var"));

%!test <66617>
%! s = struct;
%! y = structfun (@(z) z, s);
%! assert (y, zeros (0, 1));

0 comments on commit ce93562

Please sign in to comment.