Is shared delivery a common term?

Asked 2 years ago, Updated 2 years ago, 142 views

I understand that there are some types of delivery called reference delivery and price delivery, but I heard that some programming languages have a method called shared delivery.

It was my first time to hear the term myself, so I looked it up, but it didn't seem to be used very often (or rather, there are other ways to say it), and some articles said it was shared, reference price, or reference price.

Do you have any specifications or references to what is commonly referred to as shared delivery?

Read site

If I have such proper documents, I would like to use the name according to them...

programming-language

2022-09-30 21:42

2 Answers

  • There is a programming language called "shared delivery."
  • As far as I know, the word "reference price delivery" seems to be used more in Japanese.
  • However, you should be aware of the use of the term "reference value passing" for the following reasons:
    • The meaning varies slightly depending on the programming language.
    • It's confusing what the word "reference" means
  • For this reason, I personally think it's safe to choose the right way to say it depending on the programming language.
  • The meaning varies slightly depending on the programming language.
  • It's confusing what the word "reference" means

How to say "shared delivery"

There are programming languages that describe the term "call-by-sharing, pass-by-sharing" in documents and specifications.Let me give you two specific examples.

  • CLU (quoted from CLU Reference Manual, PDF)

    Argument passing is defined in terms of assignment, the formal arguments of a routine are considered to be local variables of the routine and are initialized, by assignment, to the objects resulting from the evaluation of the argument expressions. We call the argument passing technique call by sharing, because the argument objects are shared between the caller and the called routine.

  • Julia (quoted from Manual)

    Julia function arguments follow a convention items called "pass-by-sharing", which means that values are not copied when they are passed to functions.

CLU (quoted from CLU Reference Manual, PDF)

Argument passing is defined in terms of assignment, the formal arguments of a routine are considered to be local variables of the routine and are initialized, by assignment, to the objects resulting from the evaluation of the argument expressions. We call the argument passing technique call by sharing, because the argument objects are shared between the caller and the called routine.

Julia (quoted from Manual)

Julia function arguments follow a convention items called "pass-by-sharing", which means that values are not copied when they are passed to functions.

However, I don't think it's a widely used word.For example, the English version of Wikipedia "Evaluation strategy" reads:

However, the term "call by sharing" is not in common use; the terminal is inconsistent across different sources.

How to say "reference over value"

Other than the languages listed above, there are programming languages that are equivalent to "shared delivery."

In this case, it is sometimes referred to as "reference value delivery" as a special case of price delivery, and Java's example is often a hit for searching in Japanese blog posts (Example).In the case of Java, The position is that all evaluation strategies are value-delivered.When passing a reference value above this, it is sometimes referred to as passing a reference value, meaning passing a reference value.I have the impression that the word "reference value delivery" is used more often than "shared delivery", especially in Japanese.

1

In general, however, you should use this term "reference value passing" with care.One reason is that the word "reference" is troubling and has slightly different meanings depending on the programming language.

  • In Java, "reference" or "reference value" means a pointer to an object or a null pointer.Cited from Java SE12 specification JSR386:

    An object is a class instance or an array.

    The reference values (often just references) are pointers to these objects, and a
    special null reference, which references to no object.

  • In C++98, reference is an alias to an existing object or function.Especially, it is different from the pointer.C++11 also adds the concept of rvalue reference.

  • In OCaml, "reference" means a value of type ref, or a mutable indirect reference cell.

In Java, a reference or reference value is a pointer to an object or a null pointer.Cited from Java SE12 specification JSR386:

An object is a class instance or an array.

The reference values (often just references) are pointers to these objects, and a
special null reference, which references to no object.

In C++98, reference is an alias to an existing object or function.Especially, it is different from the pointer.C++11 also adds the concept of rvalue reference.

This will change the specific behavior of passing a reference.

Another reason is that のreference passing 渡しis different from but the characters are similar and complicated.2.The following programs have different results:

2
#Python-like pseudocode.
def(a):
    a = [42]

l = [99]
f(l)
print(l)# What does this output show?

Conclusion: How to use words

For these reasons, Personally,:

  • Be careful because sharing may not work.
  • Use the term "reference pricing" with caution because it is easy to misunderstand for multiple reasons.
  • It would be easier to organize how data is managed according to each programming language and simply say "price-delivering."

In particular, for the last point, in languages such as Java and Python, the function application specification only says value passing, and it also describes how data such as objects are treated as values.Personally, I think it's easier to understand if you think about it separately and add terms like this.

Order


2022-09-30 21:42

I'll leave the detailed explanation to Nekketsuuuu, which is interesting in terms of "general", so I'll give you some additional information. This is what Google Trend looks like.There is also a view like this when it comes to whether it's "general" or "everyone uses it."It can be used relatively when persuading others, so please refer to it
Enter a description of the image here


2022-09-30 21:42

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.