3

The tags and appear to refer to exactly the same concept: a language feature whereby multiple variables are assigned in a single statement. This can work differently in different languages (for example, the assignments might be done sequentially in a defined order, sequentially in an undefined order, or via some "packing/unpacking" idiom like in Python); neither tag seems adequate to disambiguate that functionality, and it doesn't seem desirable to do so anyway (since many of these questions will boil down to "what is the order of assignment in language X?").

There are not a lot of questions here (less than 50 in total it seems) so I wouldn't mind doing the retagging myself, but: which tag should be preferred? Should we set up a formal synonym? Should we use something else (for example, and rename/synonymize both?

8
  • 3
    Strong preference against "parallel assignment", as it's technically inaccurate. It's executed sequentially, even if it's done in one line of code.
    – Ryan M Mod
    Nov 8 at 0:06
  • Is it about a = b = 1 or a, b = 1, 2 in python? I can't understand that neither from (useless) wiki of one tag nor from absent wiki of another, and these two are very much different. Is this tag ambiguous?
    – STerliakov
    Nov 8 at 2:08
  • Is it related to destructuring (not to be confused with something in the Dune II series)? Tag destructuring (1,341 questions). Nov 8 at 23:18
  • Do you mean only in Python tag? Python expressions don't allow side-effects, some other languages do.
    – smci
    Nov 8 at 23:21
  • (@PeterMortensen: Python people say 'unpacking'; I take it JS people say 'destructuring'. But I dont think that's material to this question; the RHSes in general are not structures(/Python lists/tuples/etc.).)
    – smci
    Nov 8 at 23:29
  • 1
    @RyanM If a language's semantics say parallel, it's parallel, and how it's implemented isn't relevant & if the parallel semantics involve sequential atomicity/transactions/serialization that doesn't make it sequential. Parallel doesn't mean sequential.
    – philipxy
    Nov 28 at 1:39
  • @philipxy "If a language's semantics say parallel, it's parallel" I'm not 100% certain what you mean by this; are you suggesting that there is a language whose specification permits the assignments to be executed in parallel with each other? I've never heard of that; in every language I've encountered, it's more or less syntax sugar for a series of sequential assignments, and indeed an assignment need not actually execute any instructions due to, e.g., register renaming.
    – Ryan M Mod
    Nov 28 at 8:00
  • I don't know what to say because my comment already addresses that comment too. Don't call "parallel" "sequential", for reasons I gave.
    – philipxy
    Nov 28 at 8:45

1 Answer 1

0

Well, there is a subtle difference. As pointed out in a comment, parallel would imply that the assignments take place in parallel which is not always the case even when languages have multiple assignment. Languages that permit multiple/tuple assignment may still very well evaluate and assign them in a specific order, in series, even though the assignment only takes place in one line.

Parallel assignment would imply some SWAR or SIMD technique that allows multiple values to be assigned to multiple others in parallel at the same time, or at the very least, in no particular order, but that would be more 'unsequenced' than 'parallel.'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .