Editors Depot - Mission Editing and Scripting > OFP - Editing/Scripting General

Names for functions

(1/2) > >>

SoldierEPilot:
A topic to ask the last 2.5 men standing
about good English names for SQF functions.
-----------------------------------------------------------

I have 6  fns to apply some code to OFP array(s)
and to collect the result into array.
An inspiration mainly comes from here:
http://en.wikipedia.org/wiki/Map_(higher-order_function)

map - executes the code 4 each array element;
map_self - ...4 each array element, the result will be
written into original array;
map_rec - ...4 each array element on the deepest
recursion level (4 each non-array);
map_if - ..4 each array element, satisfying some condition;
map2 - ...tween each corresponded elements of two arrays;
map2_rec - ..tween each corresponded non-array elements
of two arrays (recursion);

All but "map_self" returns an array.
For example:

--- Code: --- [[1,2,3],{_x / _y},[1,2,3]] call map2
--- End code ---
returns [1,1,1].

--- Code: --- [ [1,2,[3]], {_x^2} ] call map_rec
--- End code ---
returns [1,4,[9]].

The problem: "map" is associated with island map, so
I need to use another short word as a name base.
"Do" & "forEach" are already present in the command list.
Could someone offer english word which fits the task
and shorter when "apply"?
Maybe "ply" or "hof" (higher-order function)...
Any ideas?




h-:
Out of curiosity, why it has to be shorter than 'apply'?
'ply' would be fitting abbreviation of that I guess. Or 'apl', which sounds like 'apple' though..

Also curious as to which one of us is only 0.5 Man..  :scratch:

SoldierEPilot:
>which one of us is only 0.5 Man
Or 2 * 1.25  :cool2:
A popular word construction
from Russian OFP community -
"3.5 men who makes OFP missions" etc.
Sad, but nearly true.

OK, looks like "apply" is short enough.
3 more awkward names.

building_points - all existing
"buildingPos" positions in building.
Note what NearestBuilding command works only
with buildings, not with houses without inner positions.

delim_point - point what separates p1-p2 segment
into 2 parts with some length ratio (default = 1/1).

z_angle/elevation_angle - elevation angle from
one ASL position to another.

Need more clear and shorter (if possible) names 4 them.

h-:
I don't really see the point in trying to force function names short (the game itself doesn't care) :dunno: , and making short and clear names starts be a bit of an oxymoron really.

I'd rather try to name them so that the name of the function pretty clearly tells you what it does (someone starting up just gets confused if the function name is too 'codery') regardless of the length.
Like for example BIS' own function that returns the building positions of a given building (in A2/3) is called BIS_fnc_buildingPositions; it's pretty clear on what it does although getBuildingPositions would have been clearer still I guess.

So can't really see how delim_point or elevation_angle/z_angle could be made shorter and clear at the same time. :dunno:

SoldierEPilot:
Let a clearance be a "fit function".

"building_positions" IMO looks good enough.
What can you recommend for the rest 2?

// added
delim_point alternatives: section, midpoint, section_point.
Which one is better?

Navigation

[0] Message Index

[#] Next page

Go to full version