[Survey] What do you think this reporter would do if you saw it?

Survey over - no need for any more replies thanks :slight_smile:
power_dev_elec_gas_energy_octopus script pic

Please reply in a Hide Details section so that your don't influence other peoples reply :slight_smile:


This text will be hidden

exact same thing as the "item of" block, just written in an unnecessarily confusing way and possibly slower

EDIT: i imported the block into the editor, it has a default value of 1 for the right slot, so this guess is probably what you were thinking or wherever you got this block from


Get the index of thing in list

Off-topic: I found this on wikipedia :slight_smile: Add_all_numbers_block

Off topic, your "Details" section headings seems to be localized (PL).


If I saw that, I would guess it would grab the index of thing in the list. If the list input wasn't a list input, I'd have no idea what it would do.

My guess

If thing is in the list, it returns the (first if thing is in there more than once) index of thing in the list; otherwise, 0.

set [list] to (list [Alpha] [Bravo] [Charlie] [Delta] [Bravo])
((list) index [Alpha]) = 1
((list) index [Bravo]) = 2
((list) index [Charlie]) = 3
((list) index [Delta]) = 4
((list) index [Echo]) = 0

This reporter, I feel like, should report the value at the key of β€œthing” in the provided dictionary. If the key does not exist, then the reporter returns an error.


Right now? Judging that its a list block, it would say it indexes the item in a list, like the index block

If i didn't know what the index block did, then i would not know.


Report the index of thing (1st appearance) within the referenced list.

Thanks for all the replies :slight_smile:


Most people thought it would give the same as index of (thing) in (list) which is what I wanted to communicate

OK … so why bother inventing a new block mimicking an existing Snap! primitive?

I was looking for a physically smaller reporter to do the same job

How about the APL-ish: untitled script pic 19 ? :slight_smile:

The index of x in list


Nice but I don't think that will mean much to most people.

But @qw23 you got me thinking - is there an exisiting APL reporter that returns the index and there is :slight_smile:

untitled script pic (57)

so maybe I could use
untitled script pic (60)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.