I'm having trouble converting an older model to Netlogo 6. Specifically, I have two reporters process lists that I can't get to work correctly with the new syntax. Both incorporate the old ?2 ?1 syntax used in V5.0 and below. I would appreciate any assistance. Here is the code
to-report util-partial-sums [#lst]
set #lst (fput [0] #lst)
report butfirst reduce [lput (?2 + last ?1) ?1] #lst
end
to-report util-compare-adjacent-pairs-in-list [randnum specieslist]
let post 0
let list1 (butlast specieslist)
let list2 (butfirst specieslist)
ifelse randnum <= first specieslist [set post 0]
[ifelse randnum > last specieslist [set post position (last specieslist) specieslist]
[
(foreach list1 list2 [
if randnum > ?1 and randnum <= ?2 [set post ((position ? specieslist) + 1)]])
]
]
report post
end