Skip to content

Commit

Permalink
doc/faq: move question to correct section (#28997)
Browse files Browse the repository at this point in the history
(cherry picked from commit f77c36b)
  • Loading branch information
stev47 authored and KristofferC committed Sep 8, 2018
1 parent 43f502a commit cc6988c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions doc/src/manual/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ obj3 = MyModule.someotherfunction(obj2, c)
...
```

### How do I check if the current file is being run as the main script?

When a file is run as the main script using `julia file.jl` one might want to activate extra
functionality like command line argument handling. A way to determine that a file is run in
this fashion is to check if `abspath(PROGRAM_FILE) == @__FILE__` is `true`.

## Functions

### I passed an argument `x` to a function, modified it inside that function, but on the outside, the variable `x` is still unchanged. Why?
Expand Down Expand Up @@ -645,13 +651,6 @@ as nothing but rather a tuple of zero values.
The empty (or "bottom") type, written as `Union{}` (an empty union type), is a type with
no values and no subtypes (except itself). You will generally not need to use this type.


### How do I check if the current file is being run as the main script?

When a file is run as the main script using `julia file.jl` one might want to activate extra
functionality like command line argument handling. A way to determine that a file is run in
this fashion is to check if `abspath(PROGRAM_FILE) == @__FILE__` is `true`.

## Memory

### Why does `x += y` allocate memory when `x` and `y` are arrays?
Expand Down

0 comments on commit cc6988c

Please sign in to comment.