How to initialise an abstract in Julia?

68 views Asked by At
Julia> abstract Shape
ERROR: syntax: extra token "Shape" after end of expression
Stacktrace:
 [1] top-level scope at REPL[64]:0

Just wanted to create an abstract but it says following even when I use help?> Is there any alternate to this?

help?> abstract
search: AbstractSet abstract type AbstractChar AbstractDict AbstractFloat

Couldn't find abstract
Perhaps you meant struct or AbstractSet
  No documentation found.

  Binding abstract does not exist.
1

There are 1 answers

0
David Sainez On BEST ANSWER

The correct syntax is abstract type Shape end.

You can find the docs in the REPL help mode with the full keyword:

help?> abstract type

There is online documentation on the keyword and more general documentation on types.