Difference between revisions of "Array as a list of parameters"

From Lazarus wiki
Jump to navigationJump to search
Line 15: Line 15:
  
 
== Pros ==
 
== Pros ==
* This feature will cause the already existed format function, to be valid without the need to rewrite it.
+
# This feature will cause the already existed format function, to be valid without the need to rewrite it.
* This feature will give better design for how and what data types we are going to use. Instead of writing loops, and even think on different ways of design for output.
+
# This feature will give better design for how and what data types we are going to use. Instead of writing loops, and even think on different ways of design for output.
* Instead of rewriting "every"tm function that developers need to deal with array values, while they accept only open array/array of const,  
+
# Instead of rewriting "every"<sup>tm</sup> function that developers need to deal with array values, while they accept only open array/array of const,  
*
+
# The write/writelng and read/readln procedures are pasado procedures that created on compile time by the compiler. This option allow the compiler to create such things when developers find themselves need to create their own System unit, or just create pesado procedures just like write/writeln.
 +
# This feature will give us debug or just content reading and writing, without any special code written to do so.
 +
 
 +
== Cons ==

Revision as of 19:23, 23 October 2006

Forward

This is an attempt to draw the idea behind using array as a list of values. This values can be added as a list of parameters inside open array/array of const, instead of a variable type of variable, where the type of for example "array of string".

I will try to write the good and bad regarding that issue, and I will try to explain why I think it is a good and in my opinion a very important feature that FPC can have.

This description will bring out problems, or a need to solve something, and will try to explain how this thing can help, or where I can find problems with that feature.

I hope more people will contribute to this drawing, so we could have this feature implemented in the best way we can have.

Why Do we need such feature ?

To answer that question, let me give you examples, that this feature will solve:

  • We have an array of values from an SQL result, and we wish to use that array, to add for example and output using the "format" function. At this point, in order to do so, we will have to create our own "format" function that will take the array and replace string according to the format string rules, so we could go over all of the fields that an array have.

Pros

  1. This feature will cause the already existed format function, to be valid without the need to rewrite it.
  2. This feature will give better design for how and what data types we are going to use. Instead of writing loops, and even think on different ways of design for output.
  3. Instead of rewriting "every"tm function that developers need to deal with array values, while they accept only open array/array of const,
  4. The write/writelng and read/readln procedures are pasado procedures that created on compile time by the compiler. This option allow the compiler to create such things when developers find themselves need to create their own System unit, or just create pesado procedures just like write/writeln.
  5. This feature will give us debug or just content reading and writing, without any special code written to do so.

Cons