Skip to content

2020saurav/oz-sublime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sublime Plugin for Oz (Mozart)

================================

Features

  • Syntax Highlight
  • Autocompletion
  • Build and Run from Sublime Text

Installation

This installation procedures ensures automatic upgrades from the github repo.

  • Press Ctrl+Shift+P and select Add repository

Package Control: Add Repository

Alternate Installation

  1. Clone the repository or download ZIP and extract to Oz directory git clone https://github.com/2020saurav/oz-sublime Oz

  2. Move this directory to Sublime package config mv /path/to/Oz/ ~/.config/sublime-text-3/Packages/

Usage

Use Ctrl+B to build and Ctrl+Shift+B to build & run

Sample Codes

  • Hello World
functor
import
	Browser(browse:Browse)
	System(showInfo:Print)

define
	{Browse 42}
	{Print "Hello World in console"}
end
  • Scope, function, thread
functor
import
	System(showInfo:Print)

define
	local Factorial in
		fun {Factorial N}
			if N==0 then 1 else N*{Factorial N-1} end
		end
		{Print {Factorial 5}}
	end
	local Test in
		Test = 42
		{Print Test}
	end
	fun {Fib X}
		case X
		of 0 then 1
		[] 1 then 1
		else thread {Fib X-1} end + {Fib X-2} end
	end
	{Print {Fib 10}}
end
  • Tail Recursion
 functor
import
	System(showInfo:Print)
define
	fun {Factorial N}
		fun {FactorialAux N Product}
			if N==0
			then Product
			else {FactorialAux N-1 N*Product}
			end
		end
	in 
		{FactorialAux N 1}
	end
	{Print {Factorial 5}}
end

WARNING

Closing the browser window does not send a SIGINT interrupt signal, so the process ozwish and ozemulator lives unless explicitly killed. Browser opened from command line can be killed by sending SIGINT by Ctrl+C. To make it easy, one may keep alias in .bashrc:

alias ozkill='kill -9 `pidof ozemulator` && kill -9 `pidof ozwish`'

About

Sublime Plugins for Oz : Build, Run, Autocompletion

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •