# Function definition and semi-column

**URL:** <https://discuss.ocaml.org/t/function-definition-and-semi-column/13398>\
**Category:** Learning\
**Tags:** ocaml\
**Created:** [November 10, 2023, 8:06pm UTC](https://discuss.ocaml.org/t/function-definition-and-semi-column/13398 "2023-11-10T20:06:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NAlec](https://avatars.discourse-cdn.com/v4/letter/n/91b2a8/32.png) [@NAlec](https://discuss.ocaml.org/u/NAlec)\
**Post date:** [November 10, 2023, 8:06pm UTC](https://discuss.ocaml.org/t/function-definition-and-semi-column/13398/1 "2023-11-10T20:06:49Z")

</div>

Hello,

I don’t understand the second part of this sequence :

```auto
# let test () = ();;
val test : unit -> unit = <fun>
# test ();;
- : unit = ()
# let test () = ()
  test;;
Lines 1-2, characters 14-4:
1 | ..............()
2 | test..
Error: The constructor () expects 0 argument(s),
       but is applied here to 1 argument(s)

```

I need to use the second part of the sequence because I am writing my code in a file. So I don’t use the `;;` to separate my statements. I don’t get how to separate them so that I first have the definition of test, then the call of the function without any argument (or even with an `()` argument it does not work).

---

<div class="post-metadata">

**Author:** ![octachron](https://avatars.discourse-cdn.com/v4/letter/o/49beb7/32.png) [@octachron](https://discuss.ocaml.org/u/octachron)\
**Post date:** [November 10, 2023, 8:14pm UTC](https://discuss.ocaml.org/t/function-definition-and-semi-column/13398/2 "2023-11-10T20:14:42Z")

</div>

Newlines are not significant in OCaml. Your second phrase reads as

```ocaml
let test () = () test

```

when you meant

```ocaml
let test () = ();;
test ()

```

or

```ocaml
let test () = ()
let () = test ()

```

---

<div class="post-metadata">

**Author:** ![NAlec](https://avatars.discourse-cdn.com/v4/letter/n/91b2a8/32.png) [@NAlec](https://discuss.ocaml.org/u/NAlec)\
**Post date:** [November 10, 2023, 10:01pm UTC](https://discuss.ocaml.org/t/function-definition-and-semi-column/13398/3 "2023-11-10T22:01:21Z")

</div>

Thank you octachron. It make sense know.
