I was wondering. Are there languages that use only pass-by-reference as their eval strategy?
相关问题
- Pythonic Way To Check for A Parameter Type
- Is divide by zero an error or an exception?
- passing search parameter through jquery
- pass by reference in assembly
- ISCC - /D compiler-parameter seems to have no effe
相关文章
- Are there any reasons not to use “this” (“Self”, “
- pass by reference c++
- If CancellationToken is a struct and is passed by
- Call/Return feature of classic C++(C with Classes)
- Accessing variables in a function within a functio
- What are the major differences between C and C++ a
- Pass-by-value (StringBuilder vs String) [duplicate
- passing arguments in google apps script
VB (pre .net), VBA & VBS default to ByRef although it can be overriden when calling/defining the sub or function.
FORTRAN does; well, preceding such concepts as pass-by-reference, one should probably say that it uses pass-by-address; a FORTRAN function like:
will have a C-style prototype of:
and you could call it via something like:
Another example are languages that do not know function arguments as such but use stacks. An example would be Forth and its derivatives, where a function can change the variable space (stack) in whichever way it wants, modifying existing elements as well as adding/removing elements. "prototype comments" in Forth usually look something like
and that means the function takes/processes a certain, not necessarily constant, number of arguments and returns, again, not necessarily a constant, number of elements. I.e. you can have a function that takes a number
N
as argument and returnsN
elements - preallocating an array, if you so like.I don't know what an "eval strategy" is, but Perl subroutine calls are pass-by-reference only.
How about Brainfuck?