Clojure.  Follow instructions on lynda.com  Can install all this in other ways, but this is the easiest way to get a development environment working.

Slides:



Advertisements
Similar presentations
TO YOUR LAPTOP How to Add a Printer Lesson 3 – November 18, 2013 – Michelle Lowe.
Advertisements

Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
Downloading, Installing, and Working with Dropbox.
CS115 HOW TO INSTALL THE JAVA DEVELOPMENT KIT (JDK)
Installation on Windows Vista/Windows 7 NOTE: Installation on Windows Vista can differ depending on the version of Windows installed​ ​ In most computers.
Downloading and Installing AutoCAD Architecture 2015 This is a 4 step process 1.Register with the Autodesk Student Community 2.Downloading the software.
Installing geant4 v9.5 using Windows Daniel Brandt, 06 April 2012 Installing Geant4 v9.5 for Windows A step-by-step guide for Windows XP/Vista/7 using.
Created in 2011 at Liberty High School. Getting Started Overview on Magnet Tool – Graphics – Text – Image – Video – Sound – Wall A Sample Glog How to.
HCare access on an iPad hCare access is the remote access to PGH. The steps for installing vary from the Mac somewhat. This will guide you. Installation.
The basics of the Online Portal
Panorama High School E.G.P./ Training to Put Students’ Grades on the Website Wednesday, September 29,
How to Download and Install a Sharp Print Driver on a Mac.
Microsoft Windows LEARNING HOW USE AN OPERATING SYSTEM 1.
1 Mobile Computing Set Up Copyright 2015 by Janson Industries.
Introduction to Android. Android as a system, is a java based operating system that runs on the Linux kernel. The system is very lightweight and full.
Installing and Using Active Directory Written by Marc Zacharko.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.
Downloading and Installing Autodesk Revit 2016
An Introduction to Designing and Executing Workflows with Taverna Aleksandra Pawlik materials by: Katy Wolstencroft University of Manchester.
9/2/ CS171 -Math & Computer Science Department at Emory University.
By Jesus Juarez. Download the software from or your preferred website.
Setting Up Eclipse. What is Eclipse? Eclipse is a free, downloadable software that allows us to create, compile, and run JAVA programs.
GumTree Development Environment Setup Windows Only Compatible with Eclipse 3.2 M3 (Last update: 16/11/05)
Downloading and Installing Autodesk Inventor Professional 2015 This is a 4 step process 1.Register with the Autodesk Student Community 2.Downloading the.
Introduction to Web Services. Examples Using a Web Service Creating a new Web Service.
Tool Install How to download & install Java 6 & Eclipse updated version based on Dr. G. L. Ray’s slides.
Employee Self Service Review and Print Your Payroll Results 1.
Installing SAS 1. Requirements If you do not have an old copy of SAS installed on your computer, go directly to Slide 6. Make sure you have uninstalled.
1 Installing Java on Your PC. Installing Java To develop Java programs on your PC: Install JDK (Java Development Kit) Add the directory where JDK was.
Copy of the from the secure website - click on the AccoridaLife.zip link.
Installing Drivers on HP Plotter Step By Step Instructions by Plotter4u.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
Practical Kinetics Exercise 0: Getting Started Objectives: 1.Install Python and IPython Notebook 2.print “Hello World!”
If you don’t have Google Earth downloaded already, you can go to to get it.
Troubleshooting Dashhawk Issues. Here's what you have to do to have the DashHawk run properly Go to the ACTUAL PROGRAM file (not the short cut)
 There are three things to get Trend Micro software for your PC. They are Download, Installation and Activation of the software license. Trend Micro.
Creating an Account on GLOW
Tips for using Java with Internet Explorer
Downloading & Installing the BIT115 Software & Programs
Word Lesson 1 Microsoft Word Basics
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Development Environment
Technology Staff Development, April 2011
2 At the top of the zone in which you want to add the Web Part, click Add a Web Part. In the Add Web Parts to [zone] dialog box, select the check box of.
ATS Application Programming: Java Programming
Java on the LEGO Mindstorms EV3
2 At the top of the zone in which you want to add the Web Part, click Add a Web Part. In the Add Web Parts to [zone] dialog box, select the check box of.
Android 基礎.
Contact us to fix AVG Error Code 0xe001f921
Bomgar Remote support software
1. Press the Power button or switch to flip on the printer, if it is turn off. 2. From the Home display screen on the product control panel, click the.
Installing the HP LaserJet Pro 500 color MFP M570 printer software in Windows on a Wireless Network & Wired Network.
Technical expert studying and writing helpful articles on antivirus and other security products.
CCA Skill Certification
Windows Internet Explorer 7-Illustrated Essentials
Setting up Eclipse Locally
Learn… Create… Program
Learn… Create… Program
EBSCOhost Page Composer
CS115 HOW TO INSTALL THE JAVA DEVELOPMENT KIT (JDK)
Download and Installation of code::blocks
Software Setup & Validation
How to create an Itunes account to your computer
Learn… Create… Program
Learn… Create… Program
Java Code Review with CheckStyle
Building a healthy nation is what we do. Sidra Supplier Bid Submission.
Workshop for Programming And Systems Management Teachers
Presentation transcript:

Clojure

 Follow instructions on lynda.com  Can install all this in other ways, but this is the easiest way to get a development environment working  Mac  Must have java 1.6 or higher  Must have homebrew ( ▪ Copy script and run in terminal  Install the leiningen system and clojure  brew install leiningen

 Must have java  Go to leiningen web site  Download installer  installs

 Go to terminal (Mac) or cmd (Windows)  Type “lein repl”  User ==>  Type “(println “Hello World”)  Should print to terminal  Type “exit”  This is the simplest and least effective way of running clojure

 To start a new project on a Mac:  Go to terminal  Type “lein new hello”  “lein” is for the project manager leiningen  “new” means start a new project  “hello” is the name of the project  Will create a folder called hello leiningen is a project manager. We’ll use it to create Clojure projects

 Note: this is very tricky. The instructions in the video did not work.  There are lots of plug-ins for emacs + clojure, most require some tweaking.  Easier to use intellij.

 Download intellij  You can use the community version  Mac: open the dmg, drag to applications folder  Windows: download the installer and run

 Run intellij  Can keep the plug-ins, accept defaults  Must install “cursive”  On Mac: note that lynda video is wrong!  Ignore the “new project” screen.  Preferences -> plugins, then choose Cursive  Requires a free license; go to web site  Will ask for this when you first load it

 Run intellij  Can keep the plug-ins, accept defaults  Must install “cursive”  On Windows: note that lynda video is wrong!  On start up dialog box in bottom right, click “Configure” then choose “Plugins”.  Choose “Browse repositories” button on bottom  Search for Cursive.  Install, restart intellij ▪ Requires a free license; go to web site ▪ Will ask for this when you first load it ▪ Register on Cursive web site: ▪ Click on the “Get a license” button. ▪ Note that you must copy the entire license from opening comment to closing comment.

 Must download files from lynda.com  There’s a link on the “up and running with Clojure” page

 Import project  This is an option when you first start intellij ▪ Or choose File  New  Project from existing sources  Find the “ch02” project that we downloaded from lynda.com ▪ Select the “ch02” project folder  Select “leiningen” as the project model. Click next  Click next again  Now intellij asks for the version of java. Default is fine. If there are none listed, click “+”, jdk, then use the default.

 In the navigator window on the left  Open the ch02 folder then the src folder then the ch02 folder  Double click “core.clj”  Now go to button in bottom left corner.  Hover, then choose “repl”  Window on right opens up  Right click on project name “ch02” in nav bar on left  Choose “create REPL for hello”  Click “ok” in dialog box. Wait for it to start.  Right click on project name again  Choose “Run REPL for Hello  Wait for it to start (can take a long time)  Right click in the center window (with “hello.core” at the top)  At the bottom of the dialog box choose “REPL” then “Load file in REPL”  Right click in the center window again  Choose REPL then “Switch REPL NS to current file” NOTE!! You might have to be on the internet to resolve dependencies! Only do this once

 In the box at the bottom right  Type “(get-x)”  Shift-enter  Solution appears in the REPL

 Open intellij  Choose “import project”  Find the files from lynda.com on your computer  Choose the ch02 folder  On next window check “import from external model” then choose “leiningen”  On next window just click “next” to accept the project directory  On next window “Select Leiningen projects to import” just click “next”  On jdk page just click “next”. If you don’t see any paths in the window, you might have a problem.  On next page you can select a new project name or accept the default “ch02”. Click “Finish”  In dialog box select “Yes” when it says that the folder already exists.  You might have to enter your license for Cursive.

 In the nav bar on left  Open “ch02”, then Open “src”, then Open “ch02” again  Double click “core.clj”  Right click on project name (ch02)  Choose “Run REPL for ch02  Wait for it to start (can take a long time)  In the bottom right panel type: (println “Hello World”)  should result in: Hello World =>nil

 How do we load the file in the editor in the REPL?  Right click in the center window (with “ch02.core” at the top)  At the bottom of the dialog box choose “REPL” then “Load file in REPL”  Right click in the center window again  Choose REPL then “Switch REPL NS to current file”  Now can use the forms defined in the file in the REPL window  Example: type the letter a in the bottom right hand box (this is the REPL)  The display in the box above prints a => 2

 Read  Evaluate  Print  Loop Clojure is a compiled language. When you hit the “enter” key, the code that you entered is compiled into a Java class and then run. The code that you entered is called a “form”. Clojure is a one pass compiler. So functions must be defined before they can be used (exception: the declare statement)

 Can define variables with def  And use them.  If you load the namespace, can see results in the REPL  Can define functions with defn  If use a function before it is defined, must declare that function first. (def a 2) (def b (+ 40 a) ) (declare get-y) (defn get-x [ ] (+ (get-y) 4)) (defn get-y [ ] 38)

 Scope  Global scope  Everything defined in global scope is accessible  Go to ch02 file and uncomment the #_ line.  What happens when you load the file into the REPL? (def a 2) (def b (+ 40 a) ) (defn fire-the-MISSILES!!! [are-you-sure?] (if are-you-sure? (println "WWooooosh!") (println "zzzzzzzzz"))) #_(fire-the-MISSILES!!! true)

 Writing functions  Examine the functions in the ch02 file  How do you define a function?  How do you create parameters?  What does the function “i-have-two-arities” do?  How does a function return a value?

 Writing functions  In the editor, at the bottom of the page, create a function that takes one parameter, multiplies it by 12,adds 6, divides by 3, and returns the value

(defn i-have-two-arities ([x] (println x)) ([x y] (println (+ x y))))

;; variadic parameters (defn i-like-everything! [& argument-list] (println argument-list)) ;; variadic parameters (defn i-like-something! [item & argument-list] (println item argument-list))

defn make-a-fn-that-knows-the-secret [password] (let [the-secret password] (fn [password] (if (= password the-secret) :ok :fail!)))) (def check-password (make-a-fn-that-knows-the-secret "cats")) When run: (check-password “cats”)  :ok (check-password “dogs”) => :fail!