Skip to content
rdbyk edited this page Feb 11, 2018 · 133 revisions

Hints for Efficient Balisc/Scilab 6.x Coding

  • Use type instead of typeof, whenever possible.
  • Use nargin, nargout instead of argn.
  • Use x==[] instead of isempty(x), whenever possible.
  • Use x<>[] instead of ~isempty(x), whenever possible.
  • Use issquare instead of size, whenever possible.
  • Use length(x) instead of size(x,'*'), whenever possible.
  • Use x(length(x)) or x(size(x,'*') instead of x($), whenever possible.
  • Use &&, || instead of &, |, whenever possible.
  • Use ~(A || B) instead of ~A && ~B (cf. De Morgan's Laws).
  • Use ~(A && B) instead of ~A || ~B (cf. De Morgan's Laws).
  • Use execstr instead of evstr, whenever possible.
  • Use tokens instead of strsplit, whenever possible.
  • Use matrix(A,length(A),1) instead of A(:), whenever possible.

Predefined (and Protected) Variables Unique to Balisc

  • %balisc

    Useful to check whether it is Balisc, e.g. use exists("%balisc").

Clone this wiki locally