Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1031232 // mapDoubleArrayToList - map over double array (to list)

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (2743L) is out of date.

static <A> L<A> lambdaMapLike mapDoubleArrayToList(IF1<Double, A> f, double[] l) {
  L out = emptyList(l(l));
  if (empty(l)) ret out;
  int n = l.length;
  for i to n:
    out.add(f.get(l[i]);
  ret out;
}

static <A> L<A> lambdaMapLike mapDoubleArrayToList(double[] l, IF1<Double, A> f) {
  ret mapDoubleArrayToList(f, l);
}

Author comment

Began life as a copy of #1027893

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031232
Snippet name: mapDoubleArrayToList - map over double array (to list)
Eternal ID of this version: #1031232/4
Text MD5: e82f0b4b8ba647e48c85e3227866392d
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-23 19:55:32
Source code size: 337 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 129 / 208
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)