The VikiD Truth

Knowledge base / Computing

Read This! | Algorithms | AssemblyLanguage | BASH | C-Programmming | Computer Security | Databases | Emacs | Exploitation | Firewalls | Git | Javascipt | Julia | Social Engineering | Picolisp | Pharo Smalltalk | Linux | Python | Operating Systems | Machine Learning | Metasploit | Open Data Science | Networking | Machine Learning |Scheme | Unity | vim | Web Development

Julia

This page is derived in large part from the : Think Julia Book. Get new packages at: Julia Observer.

 Keywords
 abstract type  baremodule  begin    break   catch
 const          continue    do       else    elseif
 end            export      finally  for     false
 function       global      if       import  in
 let            local       macro    module  mutable struct
 primitive type quote       return   true    try
 using          struct      where    while

Assignment Statements Variable Names Expressions and Statements An expression is a combination of one or more values, variables and operators. A statement is a unit of code that has an effect. Operator Precedence String Operations

 string1 * string2,  for string concatenation
 string^x concat x repetions of string

Comments

 # for comments

Functions

Turtles Packages can be installed in the REPL by entering the Pkg REPL-mode using the key ].

(v1.0) pkg> add https://github.com/BenLauwens/ThinkJulia.jl

Before we can use the functions in a module, we have to import it with an using statement:

julia> using ThinkJulia

Docstring

"""
polyline(t, n, len, angle)

Draws n line segments with the given length and
angle (in degrees) between them.  t is a turtle.
"""
function myfunc()
end

then type ?

help?> myfunc

Conditionals and Recursion

Keyboard Input

text = readline()

Fruitful Functions Return Values Incremental Development Composition Boolean Functions More Recursion Leap of Faith One More Example Checking Types Iteration Reassignment Updating Variables The while Statement break continue Square Roots Algorithms Strings Characters A String Is a Sequence length Traversal String Slices Strings Are Immutable String Interpolation Searching Looping and Counting String Library The ∈ Operator String Comparison Case Study: Word Play Reading Word Lists Search Looping with Indices Arrays An Array is a Sequence Arrays Are Mutable Traversing an Array Array Slices Array Library Map, Filter and Reduce Dot Syntax Deleting (Inserting) Elements Arrays and Strings Objects and Values Aliasing Array Arguments Dictionaries A Dictionary Is a Mapping Dictionary as a Collection of Counters Looping and Dictionaries Reverse Lookup Dictionaries and Arrays Memos Global Variables Tuples Tuples Are Immutable Tuple Assignment Tuples as Return Values Variable-length Argument Tuples Arrays and Tuples Dictionaries and Tuples Sequences of Sequences Case Study: Data Structure Selection Word Frequency Analysis Random Numbers Word Histogram Most Common Words Optional Parameters Dictionary Subtraction Random Words Markov Analysis Data Structures Files Persistence Reading and Writing Formatting Filenames and Paths Catching Exceptions Databases Serialization Command Objects Modules Debugging Structs and Objects Composite Types Structs are Immutable Mutable Structs Rectangles Instances as Arguments Instances as Return Values Structs and Functions Time Pure Functions Modifiers Prototyping Versus Planning Multiple Dispatch Type Declarations Methods Additional Examples Constructors show Operator Overloading Multiple Dispatch Generic Programming Interface and Implementation 18. Subtyping Cards Global Variables Comparing Cards Unit Testing Decks Add, Remove, Shuffle and Sort Abstract Types and Subtyping Abstract Types and Functions Type Diagrams Debugging Data Encapsulation The Goodies: Syntax Named Tuples Functions Blocks Control Flow Types Methods Constructors Conversion and Promotion Metaprogramming Missing Values Calling C and Fortran Code The Goodies: Base and Standard Library Measuring Performance Collections and Data Structures Mathematics Strings Arrays Interfaces Interactive Utilities Debugging

Last edited · 32 revisions

Tags: #Computing