Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #4250 > unrolled thread
| Started by | Victor Porton <porton@narod.ru> |
|---|---|
| First post | 2014-04-19 17:35 +0300 |
| Last post | 2014-04-19 17:35 +0300 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.programming
Multilevel data structure, what to pass to functions? Victor Porton <porton@narod.ru> - 2014-04-19 17:35 +0300
| From | Victor Porton <porton@narod.ru> |
|---|---|
| Date | 2014-04-19 17:35 +0300 |
| Subject | Multilevel data structure, what to pass to functions? |
| Message-ID | <liu1ke$ogq$1@speranza.aioe.org> |
The task is to generate a data structure to be passed for further
processing.
I have a multilevel hash/array. It is modified by some functions (which I am
now rewriting). Should I pass the top level hash to the function or just
that part which is to be modified?
An other variant: $x{a}{b} = myFunction(...);
An argument to pass the whole structure is that this does not require to
change function calls if in the future we decide to modify more in a
particular function.
An argument to pass only a modified portion is that we can pass a portion
which is not yet assigned to a key (and even whose parent may be not
assigned to a key) in the entire data structure.
More arguments, ideas?
--
Victor Porton - http://portonvictor.org
Back to top | Article view | comp.programming
csiph-web