Add a bunch of new languages

This commit is contained in:
Ingy döt Net 2013-04-09 00:31:41 -07:00
parent 1e05ecd7ee
commit 2a4d27cea0
158 changed files with 1469 additions and 0 deletions

View file

@ -1,7 +1,13 @@
4D:
ext: 4d
ActionScript:
ext: as
AWK:
ext: awk
B:
ext: b
Babel:
ext: pb
BASIC:
ext: bas
Befunge:
@ -12,6 +18,10 @@ Clojure:
ext: clj
CoffeeScript:
ext: coffee
Dylan:
ext: dylan
Eiffel:
ext: e
Erlang:
ext: erl
Forth:
@ -38,14 +48,26 @@ PicoLisp:
ext: l
PIR:
ext: pir
Prolog:
ext: pro
Python:
ext: py
R:
ext: r
Racket:
ext: rkt
REXX:
ext: rexx
Ruby:
ext: rb
Sather:
ext: sa
Scala:
ext: scala
Scheme:
ext: ss
Smalltalk:
ext: st
SNUSP:
ext: snusp
Tcl:

View file

@ -0,0 +1,13 @@
{{stub}}{{language|ActionScript
|site=http://www.adobe.com/devnet/actionscript.html
|gc=yes
|strength=strong
|safety=safe
|checking=static
|LCT=yes}}
{{Language programming paradigm|Distributed}}
{{Language programming paradigm|Imperative}}
{{Language programming paradigm|Event-driven}}
ActionScript is the language that drives [[wp:Adobe Flash|Flash]] behind the scenes. It is based on [[wp:ECMAScript|ECMAscript]], which is also the basis for [[JavaScript]].

View file

@ -0,0 +1 @@
../../Task/99_Bottles_of_Beer/ActionScript

1
Lang/ActionScript/FizzBuzz Symbolic link
View file

@ -0,0 +1 @@
../../Task/FizzBuzz/ActionScript

1
Lang/ActionScript/Infinity Symbolic link
View file

@ -0,0 +1 @@
../../Task/Infinity/ActionScript

View file

@ -0,0 +1 @@
../../Task/Search_a_list/ActionScript

7
Lang/B/0DESCRIPTION Normal file
View file

@ -0,0 +1,7 @@
{{language
|site=http://cm.bell-labs.com/cm/cs/who/dmr/kbman.html
|hopl id=492
}}
B is a computer language intended for recursive, primarily non-numeric applications typified by system programming. B has a small, unrestrictive syntax that is easy to compile. Because of the unusual freedom of expression and a rich set of operators, B programs are often quite compact.
B takes many features from [[derived from::BCPL]]. B is the ancestor of [[C]].

6
Lang/Babel/0DESCRIPTION Normal file
View file

@ -0,0 +1,6 @@
{{alertbox|#ffffe0|''Were you looking for the [[Common Lisp]] library? That category has now been [[:Category:Babel (library)|renamed]].''}}
{{language}}Babel is an interpreted language designed by Clayton Bauman. It is an untyped, stack-based, postfix language with support for arrays, lists and hashes (dictionaries). Babel 1.0 will support built-in crypto-based verification of code in order to enable safer remote code execution.
Babel is implemented in [[C]]. It is still under development with a v0.9 release planned for December 2012, so please excuse the dust and debris in the [https://github.com/claytonkb/Babel current implementation].
Check out the <tt>README</tt> and the <tt>doc/</tt> folder on github for more information.

View file

@ -0,0 +1 @@
../../Task/99_Bottles_of_Beer/Babel

1
Lang/Babel/Comments Symbolic link
View file

@ -0,0 +1 @@
../../Task/Comments/Babel

1
Lang/Babel/FizzBuzz Symbolic link
View file

@ -0,0 +1 @@
../../Task/FizzBuzz/Babel

15
Lang/Dylan/0DESCRIPTION Normal file
View file

@ -0,0 +1,15 @@
{{language|
|exec=machine
|strength=strong
|safety=safe
|checking=both
|gc=yes
|LCT=yes
|site=http://www.opendylan.org/}}
{{language programming paradigm|functional}}
{{language programming paradigm|procedural}}
{{language programming paradigm|imperative}}
{{Language programming paradigm|Object-oriented}}
Dylan is an [[:Category:Programming paradigm/Imperative|imperative]], [[:Category:Programming paradigm/Functional|functional]] programming language highly inspired by various [[Lisp]]s. Although original prototypes kept Lisp's s-expr based syntax, modern Dylan is written in a somewhat [[Pascal]]/[[C]]-inspired syntax. It's object system is notable for being CLOS-style (oriented around generic methods) rather than [[Smalltalk]] message-passing style. It allows for a mix of static and dynamic typing.
==Citations==
* [[wp:Dylan|Wikipedia:Dylan]]

View file

@ -0,0 +1 @@
../../Task/99_Bottles_of_Beer/Dylan

7
Lang/Eiffel/0DESCRIPTION Normal file
View file

@ -0,0 +1,7 @@
{{Stub}}{{language|Eiffel
|strength=strong
|safety=safe
|compat=nominative
|checking=static
|gc=yes
|LCT=yes}}

1
Lang/Eiffel/Infinity Symbolic link
View file

@ -0,0 +1 @@
../../Task/Infinity/Eiffel

14
Lang/Prolog/0DESCRIPTION Normal file
View file

@ -0,0 +1,14 @@
{{language|Prolog
|strength=strong
|checking=dynamic
|gc=yes
|exec=both
|LCT=yes
|compat=structural
|parampass=value
|bnf=[http://cdn.bitbucket.org/muspellsson/rosetta/downloads/prolog-bnf.html]
}}{{language programming paradigm|Declarative}}{{language programming paradigm|Logic_Programming}}
[[wp:Prolog|Prolog]] is a [[logic programming]] language. It is programmed declaratively, using ''resolution'' and ''backtracking'' to confirm propositions based on declared facts and rules.
<br clear="both">

View file

@ -0,0 +1 @@
../../Task/99_Bottles_of_Beer/Prolog

1
Lang/Prolog/Anagrams Symbolic link
View file

@ -0,0 +1 @@
../../Task/Anagrams/Prolog

1
Lang/Prolog/Bulls_and_cows Symbolic link
View file

@ -0,0 +1 @@
../../Task/Bulls_and_cows/Prolog

1
Lang/Prolog/Comments Symbolic link
View file

@ -0,0 +1 @@
../../Task/Comments/Prolog

1
Lang/Prolog/FizzBuzz Symbolic link
View file

@ -0,0 +1 @@
../../Task/FizzBuzz/Prolog

1
Lang/Prolog/Ordered_words Symbolic link
View file

@ -0,0 +1 @@
../../Task/Ordered_words/Prolog

1
Lang/Prolog/Quine Symbolic link
View file

@ -0,0 +1 @@
../../Task/Quine/Prolog

1
Lang/Prolog/Search_a_list Symbolic link
View file

@ -0,0 +1 @@
../../Task/Search_a_list/Prolog

11
Lang/R/0DESCRIPTION Normal file
View file

@ -0,0 +1,11 @@
{{language|R
|site=http://www.r-project.org/
|express=implicit}}
R is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories (formerly AT&T, now Lucent Technologies) by John Chambers and colleagues. R can be considered as a different implementation of S. There are some important differences, but much code written for S runs unaltered under R.<ref name="The R Project Web Site">http://www.r-project.org/about.html</ref>
==See Also==
* [[wp:R_%28programming_language%29|Wikipedia:R (programming language)]]
==References==
<references/>

1
Lang/R/99_Bottles_of_Beer Symbolic link
View file

@ -0,0 +1 @@
../../Task/99_Bottles_of_Beer/R

1
Lang/R/Anagrams Symbolic link
View file

@ -0,0 +1 @@
../../Task/Anagrams/R

1
Lang/R/Bulls_and_cows Symbolic link
View file

@ -0,0 +1 @@
../../Task/Bulls_and_cows/R

1
Lang/R/Comments Symbolic link
View file

@ -0,0 +1 @@
../../Task/Comments/R

1
Lang/R/Entropy Symbolic link
View file

@ -0,0 +1 @@
../../Task/Entropy/R

1
Lang/R/FizzBuzz Symbolic link
View file

@ -0,0 +1 @@
../../Task/FizzBuzz/R

1
Lang/R/Infinity Symbolic link
View file

@ -0,0 +1 @@
../../Task/Infinity/R

1
Lang/R/JSON Symbolic link
View file

@ -0,0 +1 @@
../../Task/JSON/R

1
Lang/R/Knuth_shuffle Symbolic link
View file

@ -0,0 +1 @@
../../Task/Knuth_shuffle/R

1
Lang/R/Quine Symbolic link
View file

@ -0,0 +1 @@
../../Task/Quine/R

1
Lang/R/Search_a_list Symbolic link
View file

@ -0,0 +1 @@
../../Task/Search_a_list/R

5
Lang/Racket/0DESCRIPTION Normal file
View file

@ -0,0 +1,5 @@
{{language}}
'''Racket''' (at one time called 'PLT Scheme') is a member of the Lisp and Scheme family of languages. The Racket language (like Clojure, for example) draws freely from the various strands of its lineage.
* [http://racket-lang.org Home page]
* [http://en.wikipedia.org/wiki/Racket_(programming_language) Wikipedia]

View file

@ -0,0 +1 @@
../../Task/99_Bottles_of_Beer/Racket

1
Lang/Racket/Anagrams Symbolic link
View file

@ -0,0 +1 @@
../../Task/Anagrams/Racket

1
Lang/Racket/Comments Symbolic link
View file

@ -0,0 +1 @@
../../Task/Comments/Racket

1
Lang/Racket/Entropy Symbolic link
View file

@ -0,0 +1 @@
../../Task/Entropy/Racket

1
Lang/Racket/FizzBuzz Symbolic link
View file

@ -0,0 +1 @@
../../Task/FizzBuzz/Racket

1
Lang/Racket/Infinity Symbolic link
View file

@ -0,0 +1 @@
../../Task/Infinity/Racket

1
Lang/Racket/JSON Symbolic link
View file

@ -0,0 +1 @@
../../Task/JSON/Racket

1
Lang/Racket/Pi Symbolic link
View file

@ -0,0 +1 @@
../../Task/Pi/Racket

1
Lang/Racket/Search_a_list Symbolic link
View file

@ -0,0 +1 @@
../../Task/Search_a_list/Racket

7
Lang/Sather/0DESCRIPTION Normal file
View file

@ -0,0 +1,7 @@
{{stub}}
{{language|Sather
|site=http://www.gnu.org/software/sather/
|LCT=no
}}
Sather is an object oriented language designed to be simple, efficient, safe, flexible and non-proprietary. One way of placing it in the "space of languages" is to say that it aims to be as efficient as C, C++, or Fortran, as elegant as and safer than Eiffel, and support higher-order functions and iteration abstraction as well as Common Lisp, CLU or Scheme

View file

@ -0,0 +1 @@
../../Task/99_Bottles_of_Beer/Sather

1
Lang/Sather/Comments Symbolic link
View file

@ -0,0 +1 @@
../../Task/Comments/Sather

1
Lang/Sather/FizzBuzz Symbolic link
View file

@ -0,0 +1 @@
../../Task/FizzBuzz/Sather

1
Lang/Sather/Search_a_list Symbolic link
View file

@ -0,0 +1 @@
../../Task/Search_a_list/Sather

21
Lang/Scheme/0DESCRIPTION Normal file
View file

@ -0,0 +1,21 @@
{{language|Scheme
|strength=strong
|safety=safe
|express=implicit
|checking=dynamic
|parampass=value
|gc=yes
|LCT=yes
|bnf=http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-7.html#node_chap_4}}
{{codepad}}
{{language programming paradigm|functional}}
'''Scheme''' is a multi-[[:Category:Programming Paradigms|paradigm]] programming language. It is one of the two main dialects of [[derived from::Lisp]] and supports a number of programming paradigms but is best known for its support of [[functional programming]]. It was developed by Guy L. Steele and Gerald Jay Sussman in the 1970s. Scheme was introduced to the academic world via a series of papers now referred to as Sussman and Steele's Lambda Papers. There are two standards that define the Scheme language: the official [[IEEE]] standard, and a de facto standard called the ''Revised<sup>n</sup> Report on the Algorithmic Language Scheme'', nearly always abbreviated R''n''RS, where ''n'' is the number of the revision. The current standard is '''R6RS''', and '''R7RS''' is in development.
Scheme's philosophy is minimalist. Scheme provides as few primitive notions as possible, and, where practical, lets everything else be provided by programming libraries.
Scheme was the first dialect of Lisp to choose static (a.k.a. lexical) over dynamic variable scope. It was also one of the first programming languages to support first-class continuations.
==Citations==
* [[wp:Scheme_%28programming_language%29|Wikipedia:Scheme (programming language)]]
{{implementation|Lisp}}

View file

@ -0,0 +1 @@
../../Task/99_Bottles_of_Beer/Scheme

1
Lang/Scheme/Bulls_and_cows Symbolic link
View file

@ -0,0 +1 @@
../../Task/Bulls_and_cows/Scheme

1
Lang/Scheme/Comments Symbolic link
View file

@ -0,0 +1 @@
../../Task/Comments/Scheme

1
Lang/Scheme/FizzBuzz Symbolic link
View file

@ -0,0 +1 @@
../../Task/FizzBuzz/Scheme

1
Lang/Scheme/Infinity Symbolic link
View file

@ -0,0 +1 @@
../../Task/Infinity/Scheme

1
Lang/Scheme/Knuth_shuffle Symbolic link
View file

@ -0,0 +1 @@
../../Task/Knuth_shuffle/Scheme

1
Lang/Scheme/Ordered_words Symbolic link
View file

@ -0,0 +1 @@
../../Task/Ordered_words/Scheme

1
Lang/Scheme/Quine Symbolic link
View file

@ -0,0 +1 @@
../../Task/Quine/Scheme

1
Lang/Scheme/Search_a_list Symbolic link
View file

@ -0,0 +1 @@
../../Task/Search_a_list/Scheme

288
Lang/Smalltalk/0DESCRIPTION Normal file
View file

@ -0,0 +1,288 @@
{{language|Smalltalk
|exec=bytecode
|strength=strong
|safety=safe
|express=implicit
|checking=dynamic
|parampass=value
|gc=yes
|LCT=yes
|bnf=http://github.com/aquasync/ruby-ometa/blob/60deea23abe7eb07d200233dde4213d74041b81f/smalltalk.syntax}}
{{language programming paradigm|Object-oriented}}
{{language programming paradigm|reflective}}
{{language programming paradigm|Dynamic}}
'''Smalltalk-80''' is an [[object-oriented programming|object-oriented]], dynamically typed, [[reflective programming]] language. It was designed and created in part for educational use, more so for Constructivist teaching, at Xerox PARC by Alan Kay, Dan Ingalls, Ted Kaehler, Adele Goldberg, and others during the 1970s, influenced by Sketchpad and Simula.
The language was generally released as Smalltalk-80 and has been widely used since. Smalltalk-like languages are in continuing active development, and has gathered a loyal community of users around it.
'''Smalltalk-80''' is a fully reflective system, implemented in itself. Smalltalk-80 provides both structural and computational reflection. Smalltalk is a structurally reflective system whose structure is defined by Smalltalk-80 objects. The classes and methods that define the system are themselves objects and fully part of the system that they help define. The Smalltalk compiler compiles textual source code into method objects, typically instances of <code>CompiledMethod</code>. These get added to classes by storing them in a class's method dictionary. The part of the class hierarchy that defines classes can add new classes to the system. The system is extended by running Smalltalk-80 code that creates or redefines classes and methods. In this way a Smalltalk-80 system is a "living" system, carrying around the ability to extend itself at run-time.
==Implementations==
Over time, various implementations ("dialects") of Smalltalk have appeared, some of which target different audiences and/or focus on particular applications. Their internal implementation (evaluation mechanism) may also differ radically, from bytecode interpretation, just-in-time compilation, dynamic optimizing recompilation to cross-language translators (Smalltalk-to-C, Smalltalk-to-JavaScript, Smalltalk-to-Java).
==Spirit==
Smalltalk consist of both the programming language and a more or less standardized library of classes. Most Smalltalks also include a sophisticated IDE, which supports editing, compiling, refactoring, debugging, tools, source code revisioning and packaging/deployment. With a few exceptions, working in a traditional editor (vi, emacs) or general purpose IDE (eclipse) is usually not recommended, as these cannot make use of all the reflective and dynamic coding features and will make the programmer less productive. For example, typical Smalltalk debuggers allow for code to be changed while the program is running (or halted at a breakpoint), allowing for a "programming in the debugger" style of coding. Code is usually developed and tested incrementally, with breakpoints on unimplemented parts, which are filled as encountered. This makes Smalltalk a perfect environment for rapid prototyping and experimental development.
Smalltalk environments are open - almost every aspect of the language and IDE can be changed, enhanced and customized. This includes object representation, metaclass and reflection facilities, language syntax, exception handling and the IDE itself. For this reason, Smalltalk has traditionally been a testbed for new language features, mechanisms and patterns.
Smalltalk is a very high level language, which almost completely hides any underlying machine representation. Implementation details such as integer size, pointer size, byte order etc. are invisible. The numeric tower is highly polymorphic, allowing for transparent use of arbitrary large integers, fractions, floats, complex numbers etc.
Smalltalk is a very late bound language. Object types, classes, references etc. are resolved at execution time, and can be dynamically changed.
==Language Syntax==
Smalltalk has a very simple and highly orthogonal syntax, which is based exclusively on message sending (aka pure virtual function calling in C-parlance). The language syntax and semantic only consists of literal (compile-time) constants, variable bindings, message sends and block closures (lambda expression objects). Control flow, loop constructs, exception handling etc. are defined as messages to booleans, blocks or by passing blocks as arguments. This makes it trivial and common practice to add new control constructs.
=== Grammar ===
... to be added ... (for now follow the link at the right...)
== Language Semantic ==
=== Variables and Scope ===
Variables are used to name objects. Actually they are bindings of a name to an object. Objects can only be passed and used by reference, and access to an object's internals is not possible from outside the object's own method implementation, although most classes inherit from Object, which provides some reflection protocol to access instance variables or to query for the class. However, such inherited reflection mechanisms could be overwritten in a class or a class could not inherit from Object, to prevent even access from debuggers and inspectors.
Smalltalk is lexically scoped, and outer variable bindings are closed over when a block (=lambda closure) is created.
A rich scoping hierarchy exists, which consists of:
* inner block locals
* inner block arguments
* outer block locals
* outer block arguments
* method locals
* method arguments
* instance variable slots
* inherited instance variable slots
* class variables (static, shared with subclasses; visible in the class-hierarchy only)
* class instance variables (per-class-instance; private to the class)
* pool variables (for constant pools; must be explicitly "imported" to be seen)
* namespaces / globals (for classes to be known by name)
=== Objects ===
In Smalltalk, every object is an instance of some class. Objects are only be referred to by reference. Everything is an object, including integers, booleans, nil (the UndefinedObject), classes, stack frames (continuations), exception handlers and code (block closures/lambda closures and methods). There are no builtin primitive types, which are not part of the class hierarchy, or which cannot be changed/enhanced by the user.
=== Message Sending ===
Message sends are dynamically resolved, by letting the receiver of the message determine the method (aka code to run). The message consist of a selector (= name of the message) and optional arguments. The message syntax as:
<lang smalltalk>receiver selector</lang>
a unary message, without arguments.
<lang smalltalk>receiver part1: arg1 part2: arg2 ... partN: argN</lang>
a keyword message; the selector consists of the concatenation of the keyword parts: 'part1:part2:...partN:'.
<lang smalltalk>receiver op arg</lang>
a so called ''binary message''. The selector 'op' consists of one or more special characters, such as '+', -', '@' etc.
These are actually syntactic sugar, especially to make arithmetic look more familiar (i.e. instead of "rcvr add: foo" we can write "rcvr + foo").
The precedence rules are unary > binary > keyword, thus
<lang smalltalk>a foo: b bar + c baz</lang> is equivalent to <lang smalltalk>a foo:( (b bar) + (c baz) )</lang>
As messages have no semantic meaning to the compiler (especially, the '+', '*' and other binary messages), the usual precedence rules for arithmetic expressions are not present in Smalltalk. Thus, complex expressions consisting of multiple binary messages usually need to be parenthesized.
Message lookup is done by traversing the superclass chain, looking for a class providing an implementation (method) for the messages selector. The standard defines single inheritance, with a lookup based on the receiver's class only. However, some Smalltalk implementations allow for that lookup to be redefined and provide more sophisticated mechanisms (selector namespaces, lookup objects, lookup based on argument types etc.).
If no implementation is found (i.e. no class along the superclass chain provides a corresponding method), the original selector and arguments are packed into a container and a doesNotUnderstand: message is sent instead. This is used for error handling, but can also be used for message forwarding (proxies), delegation or dynamic creation of new code. The default implementation of doesNotUnderstand: raises an exception, which can be cought and handled by the program.
=== Metaclass Hierarchy ===
Classes themself are objects and as such instances of some Metaclass. As classes define and provide the protocol (=set of methods) for their instances, metaclasses define and provide the protocol for their instances, the corresponding class. Every class has its own metaclass and as such can implement new class-side messages. Typically, instance creation and utility code is found on the class side. Most Smalltalk dialects allow for the metaclass to specify and return the type of compiler or other tools to be used when code is to be installed. This allows for DSLs or other programming language syntax to be implemented seamlessly by defining a metaclass which returns a compiler for a non-Smalltalk. Typical examples for this are parser generators (tgen, ometa, petite parser), data representation specs (asn1, xml etc.) and languages (smallRuby, graphical languages in squeak etc.)
Being objects, classes and metaclasses can be created dynamically, by sending a #subclass:... message to another class, or my instantiating a new metaclass.
=== Exception Handling ===
Smalltalk protects itself completely from any invalid memory references, null-pointer, array bounds or unimplemented message situations, by raising a corresponding exception which can be cought by the program. An unhandled exception leads to the evaluation of a default handler, which usually opens a symbolic debugger, which is always part of the Smalltalk environment. Deployed end-user and production systems usually redefine this handler to show a warning, end the program or dump the state of the system.
In contrast to most other exception handling systems, Smalltalk exceptions are both restartable and proceedable. The exception handler is evaluated with the calling chain of continuations (stack frames) still being active and alive. The handler is free to repair the situation and proceed. Proceedability allows for queries and notifications to be implemented easily using exceptions; for example, a compiler's warnings or error correction queries can be implemented this way, without a need to pass in logger objects or other state. Also situations like missing files (OpenError) can be resolved in the handler, by opening a dialog, asking the user for a replacement and proceed.
The exception framework is implemented as part of the class library, and open for change and enhancement.
== Examples ==
As smalltalk code seems to be hard to read for programmers with a C background, some examples are provided below.
=== Literals ===
<lang smalltalk>
"a comment - everything in between double quotes"
"/ an end-of-line comment (dialect specific)
true false "the two Boolean singleton objects"
nil "the UndefinedObject singleton object"
1234 "integer constant; an instance of Integer"
16rFF00 "integer constant, base 16"
2r101010 "integer constant, base 2"
1.234 "float constant; an instance of Float"
(1/7) "fraction constant; an instance of Fraction"
123s3 "fixed point constant with precision (somewhat dialect specific)
'hello' "string constant; an instance of String"
#'foo' "symbol constant; similar to symbols in lisp, two symbols are identical if they are equal"
#(1 true $a 16rFF 1.0 (10 20)) "array literal constant; the last element being another array; an instance of Array"
#[ 10 20 2r1000 16rFE ] "byte-array literal constant; an instance of ByteArray"
$a "character constant"
[ ... some code ... ] "a block literal; an instance of BlockClosure (dialect specific); the object represents the piece of code which can be passed around and evaluated later (a lambda closure)"
[:a1 ... :aN | ... some code ...] "a block literal with arguments."
</lang>
===Message Sends===
<lang smalltalk>
1000 factorial "send the 'factorial' message to the integer receiver"
a factorial even "send the 'factorial' message to whatever "a" refers to, then send 'even' to whatever that returned"
a + 1 "send a '+' message, passing the argument '1' to whatever a refers to"
(a + 1) squared "send '+' to a, then send 'squared' to whatever we get from it"
a , b "send the (binary) ',' message, which does collection-concatenation (arrays, strings, etc)
arr at:1 put:'foo' "send the 'at:put:' message to 'arr', passing two arguments, the integer '1' and a string"
a > b ifTrue: [ a print ] "send the 'ifTrue:' message to whatever 'a > b' returned (a boolean, usually), passing a block closure as argument. The implementation of boolean will either evaluate or not evaluate the passed block's code"
a > b ifTrue: [ a ] ifFalse: [b] "send 'ifTrue:ifFalse:' to the object returned by 'a > b', passing two block closures as arguments. The 'ifTrue:ifFalse:' method will evaluate one of them and return that block's return value as its own return value"
b := [ ... somCode... ].
...
b value "evaluate the block's code"
</lang>
=== Other ===
<lang smalltalk>
expr1 . expr2 "statements within a method or block are separated by a fullstop."
foo := bar "assignment; let foo refer to the object to which bar refers to (at that particular point in time)"
^ a + 1 "return; the value of the 'a+1' message send is returned as the value of the current method invocation."
'hello' print. 'world' print "statements are separated by a period; just like in english"
|a b c| "local variables; introduces 'a', 'b' and 'c' in the current scope (let-like local bindings)"
r msg1; msg2 "so called cascade; first send msg1 to r, ignoring the return value, then send msg2.
Value of expression is result from last message. Syntactic sugar for r msg1. r msg2 but an expression, not a statement"
</lang>
=== Class Definition ===
Classes are not defined by syntactic constructs, but by sending a message to some class (to create a subclass), a metaclass (to create an instance) or to a namespace (to create a class and install it). The details vary slightly among dialects, but usually wrappers/forwarders are provided or easily added if code is to be ported and any is missing in the target system.
<lang smalltalk>
someClass
subClass: #'nameOfNewClass'
instanceVariableNames: '...list of private slots...'
classVariableNames: '...list of class variables...'
poolDictionaries: '..list of imported pool bindings...'
category: 'for documentation only'.
</lang>
Classes can be anonymous, in most systems, you can "Class new new" to create a new anonymous class and an instance of it (but be aware, that the class should contain enough state to properly specify their instances layout, so usually more info is needed (number and names of instance variables, inheritance etc.)
=== Control Structures ===
As mentioned above, these are defined as messages and their implementation is found in the corresponding receiver classes. The following is only a tiny subset - there are virtually hundreds of uses of blocks for control structures in the system.
Typical are:
<lang smalltalk>
boolean ifTrue: [ block providing value if boolean is true ]
boolean ifFalse: [ block providing value if boolean is false ]
boolean ifTrue: [ value if boolean is true ] ifFalse: [ value if boolean is false ]
[ block for condition ] whileTrue: [ block to be looped over ]
n timesRepeat: [ block to be looped over ]
start to: stop do: [:i | block to be looped over with index ]
collection do: [:el | block to be evaluated for each element ]
</lang>
=== Exception Handling ===
Originally, Smalltalk used an instance based exception handling scheme, where instances of Signal where created and raised. Now, all implementations have moved to class based exceptions, where the raised exception is a subclass of Exception. As instance based exception handling is still useful in some situations (very lightweight, no need to create a class), some dialects continue to support both.
Smalltalk supports proceedable exceptions.
<lang smalltalk>
[ try block to be evaluated ] on: exception do:[:ex | handler ]
</lang>
the 'ex' argument to the hander provides detail information (where and why) and also allows control of how to proceed out of the handler (ex proceed, ex return, ex restart, ex reject).
The handler basically has the following options:
* ex return - return out of the try block
* ex restart - restart the try block
* ex reject - handler cannot handle; rethrow the exception for an outer handler
* ex proceedWith: value - proceed after where the exception was raised (after a repair)
Exceptions may be specified to be nonProceedable, to protect code from proceeding handlers, where proceeding is not possible.
Exceptions form a hierarchy, so a handler will also catch any derived exceptions. If an exception is unhandled, the original exception info is packed up and an UnhandledException is raised. Thus (similar to the handling of doesNotUnderstand:). The default handler for UnhandledException opens a debugger for the misbehaving thread (while usually other threads continue to operate as usual).
Handlers can also be defined to handle a collection of non-related exceptions, by creating an exceptionSet:
<lang smalltalk>
[ try block to be evaluated ] on: ZeroDivide, DomainError do:[:ex | handler ]
</lang>
finally, many dialects provide syntactic sugar for common situations:
<lang smalltalk>
exception catch: [ action ] - to return out of the action, without any particular handler action
exception ignoreIn: [ action ] - to ignore the exception and proceed (for example: a UserInterruptSignal, as generated by the CTRL-C key)
</lang>
=== Unwinding ===
Ensure blocks to make sure that cleanup is performed correctly even in exception situations are defined as:
<lang smalltalk>
[ action to be performed ] ensure: [ action to cleanup] - will cleanup in any case (i.e. both in normal and in unwind situations)
[ action to be performed ] ifCurtailed: [ action to cleanup] - will cleanup only in unwind situations
</lang>
=== Multithreading ===
New threads are started by sending 'fork' to a block; this will create a process instance which executes the block's code in a separate thread (within the same address space):
<lang smalltalk>
[ do something ] fork.
[ do something ] forkAt: priorityLevel
</lang>
the scheduling behavior is not standard among dialects; some only manual switches by explicit yield, most provide sctrict priority based scheduling, and some even provide preemtive timeslicing, and dynamic priorities. The details also depend on the underlying operating system.
== Implementation ==
Most Smalltalk implementations are based on a bytecode execution engine. Bytecode is emitted and stored in method objects by a compiler which is part of both the development and runtime environment (in contrast to external tools, like javac). Bytecodes are operations for a virtual stack based machine, which is either interpreted by an interpreter (part of the runtime system), or dynamically compiled to machine code (JITTER). Bytecode is not standardized and usually not compatible among dialects.
Some implementations support source-to-source compilation to C, JavaScript or Java. These may or may not show some limitations in the support for dynamic changes at execution time. Typically, the full dynamic bytecode is used for development, followed by a compilation phase for deployment/packaging.
All Smalltalks use and depend on garbage collection for automatic reclamation of unused objects, and most implementations use modern algorithms such as generation scavenging, incremental mark&sweep and finalization support. Imprecise conservative collectors are typically not used. Reference counting was abandoned in the 70s.
As message send performance is critical in Smalltalk, highly tuned cache mechanisms have been invented and are used: inline caches, polymorph inline caches, dynamic recompilation based on receiver and/or argument types etc.
Also block creation and evaluation, especially the treatment of closed over variables has been in the focus of implementors. Algorithms similar to those found in sophisticated Lisp systems such as lambda lifting, inlining, stack allocation and heap migration etc. are also used in Smalltalk.
== Influences ==
Smalltalk syntax is meant to be read like english sentences.
Smalltalk's symbols correspond to Lisp symbols, blocks are syntactic sugar for lambda closures.
ObjectiveC's message send, syntax and keyword format is a direct subset of the corresponding Smalltalk message send syntax. Also the semantic of its classes and instances are similar. However, the reflection and metaclass facilities are a small subset.
Java's container and stream class hierarchy has similarities to Smalltalk collection classes. MVC as used in many toolkits has been in Smalltalk for a long time.
Self a descendent of Smalltalk, uses a similar syntax, blocks and exception facilities, but adds instance based inheritance, dynamic slots and mirrors.
Slate and Newspeak use similar syntax and message send semantics
JavaScript's functions are a syntactic different but semantically equal to Smalltalk's blocks, including scoping rules (but lack the capability of returning from their containing function).
==Implementations==
* Amber Smalltalk
* Dolphin Smalltalk; (still actively developed?)
* GNU Smalltalk; open source
* Pharo; open source, mostly compatible to Squeak
* S#
* Smalltalk/X; free for private and commercial use
* Smalltalk-MT; (still actively developed?)
* Squeak; open source
* VisualAge Smalltalk (Instantiations; formerly known as IBM Smalltalk); free for private use
* VisualWorks (Cincom) Smalltalk; free for private use
==Citations==
* [[wp:SmallTalk|Wikipedia:Smalltalk]]

View file

@ -0,0 +1 @@
../../Task/99_Bottles_of_Beer/Smalltalk

1
Lang/Smalltalk/Anagrams Symbolic link
View file

@ -0,0 +1 @@
../../Task/Anagrams/Smalltalk

View file

@ -0,0 +1 @@
../../Task/Bulls_and_cows/Smalltalk

1
Lang/Smalltalk/Comments Symbolic link
View file

@ -0,0 +1 @@
../../Task/Comments/Smalltalk

1
Lang/Smalltalk/FizzBuzz Symbolic link
View file

@ -0,0 +1 @@
../../Task/FizzBuzz/Smalltalk

1
Lang/Smalltalk/Infinity Symbolic link
View file

@ -0,0 +1 @@
../../Task/Infinity/Smalltalk

View file

@ -0,0 +1 @@
../../Task/Knuth_shuffle/Smalltalk

View file

@ -0,0 +1 @@
../../Task/Ordered_words/Smalltalk

1
Lang/Smalltalk/Quine Symbolic link
View file

@ -0,0 +1 @@
../../Task/Quine/Smalltalk

View file

@ -0,0 +1 @@
../../Task/Search_a_list/Smalltalk

View file

@ -0,0 +1,7 @@
for(var numBottles:uint = 99; numBottles > 0; numBottles--)
{
trace(numBottles, " bottles of beer on the wall");
trace(numBottles, " bottles of beer");
trace("Take one down, pass it around");
trace(numBottles - 1, " bottles of beer on the wall\n");
}

View file

@ -0,0 +1,17 @@
main: { 99 bottles }
bottles!:
{ x set
{ bw
bx cr <<
"Take one down, pass it around\n" <<
1 x -=
bw "\n" << }
x times }
b : " bottles of beer"
bx!: { x %d << b }
w : " on the wall"
bw!: { bx w . cr << }
x: [0]

View file

@ -0,0 +1,10 @@
Module: bottles
define method bottles (n :: <integer>)
for (n from 99 to 1 by -1)
format-out("%d bottles of beer on the wall,\n"
"%d bottles of beer\n"
"Take one down, pass it around\n"
"%d bottles of beer on the wall\n",
n, n, n - 1);
end
end method

View file

@ -0,0 +1,19 @@
line1(X):- line2(X),write(' on the wall').
line2(0):- write('no more bottles of beer').
line2(1):- write('1 bottle of beer').
line2(X):- writef('%t bottles of beer',[X]).
line3(1):- write('Take it down, pass it around').
line3(X):- write('Take one down, pass it around').
line4(X):- line1(X).
bottles(0):-!.
bottles(X):-
succ(XN,X),
line1(X),nl,
line2(X),nl,
line3(X),nl,
line4(XN),nl,nl,
!,
bottles(XN).
:- bottles(99).

View file

@ -0,0 +1,10 @@
bottles(0):-!.
bottles(X):-
writef('%t bottles of beer on the wall \n',[X]),
writef('%t bottles of beer\n',[X]),
write('Take one down, pass it around\n'),
succ(XN,X),
writef('%t bottles of beer on the wall \n\n',[XN]),
bottles(XN).
:- bottles(99).

View file

@ -0,0 +1,5 @@
#only one line!
cat(paste(99:1,ifelse((99:1)!=1," bottles"," bottle")," of beer on the wall\n",99:1,ifelse((99:1)!=1," bottles"," bottle")," of beer\n","Take one down, pass it around\n",98:0,ifelse((98:0)!=1," bottles"," bottle")," of beer on the wall\n\n",sep=""),sep="")
#alternative
cat(paste(lapply(99:1,function(i){paste(paste(rep(paste(i,' bottle',if(i!=1)'s',' of beer',sep=''),2),collapse =' on the wall\n'),'Take one down, pass it around',paste(i-1,' bottle',if(i!=2)'s',' of beer on the wall',sep=''), sep='\n')}),collapse='\n\n'))

View file

@ -0,0 +1,16 @@
#a naive function to sing for N bottles of beer...
song = function(bottles){
for(i in bottles:1){ #for every integer bottles, bottles-1 ... 1
cat(bottles," bottles of beer on the wall \n",bottles," bottles of beer \nTake one down, pass it around \n",
bottles-1, " bottles of beer on the wall \n"," \n" ,sep="") #join and print the text (\n means new line)
bottles = bottles - 1 #take one down...
}
}
song(99)#play the song by calling the function

View file

@ -0,0 +1,11 @@
#lang racket
(define (plural n)
(string-append (number->string n) " bottle" (if (equal? n 1) "" "s")))
(define (sing bottles)
(printf "~a of beer on the wall\n~a of beer\nTake on down, pass it around\n~a of beer on the wall\n\n"
(plural bottles) (plural bottles) (plural (sub1 bottles))))
(for ((i (in-range 100 0 -1)))
(sing i))

View file

@ -0,0 +1,14 @@
class MAIN is
main is
s :STR;
p1 ::= "<##> bottle<#> of beer";
w ::= " on the wall";
t ::= "Take one down, pass it around\n";
loop i ::= 99.downto!(0);
if i /= 1 then s := "s" else s := ""; end;
#OUT + #FMT(p1 + w + "\n", i, "s");
#OUT + #FMT(p1 + "\n", i, "s");
if i > 0 then #OUT + t; end;
end;
end;
end;

View file

@ -0,0 +1,7 @@
(define (bottles x)
(format #t "~a bottles of beer on the wall~%" x)
(format #t "~a bottles of beer~%" x)
(format #t "Take one down, pass it around~%")
(format #t "~a bottles of beer on the wall~%" (- x 1))
(if (> (- x 1) 0)
(bottles (- x 1))))

View file

@ -0,0 +1,15 @@
Smalltalk at: #sr put: 0 ; at: #s put: 0 !
sr := Dictionary new.
sr at: 0 put: ' bottle' ;
at: 1 put: ' bottles' ;
at: 2 put: ' of beer' ;
at: 3 put: ' on the wall' ;
at: 4 put: 'Take one down, pass it around' !
99 to: 0 by: -1 do: [:v | v print.
( v == 1 ) ifTrue: [ s := 0. ]
ifFalse: [ s := 1. ].
Transcript show: (sr at:s) ; show: (sr at:2) ; show: (sr at:3) ; cr.
v print.
Transcript show: (sr at:s) ; show: (sr at:2) ; cr.
(v ~~ 0) ifTrue: [ Transcript show: (sr at:4) ; cr. ].
].

View file

@ -0,0 +1,49 @@
:- use_module(library( http/http_open )).
anagrams:-
% we read the URL of the words
http_open('http://www.puzzlers.org/pub/wordlists/unixdict.txt', In, []),
read_file(In, [], Out),
close(In),
% we get a list of pairs key-value where key = a-word value = <list-of-its-codes>
% this list must be sorted
msort(Out, MOut),
% in order to gather values with the same keys
group_pairs_by_key(MOut, GPL),
% we sorted this list in decreasing order of the length of values
predsort(my_compare, GPL, GPLSort),
% we extract the first 6 items
GPLSort = [_H1-T1, _H2-T2, _H3-T3, _H4-T4, _H5-T5, _H6-T6 | _],
% Tnn are lists of codes (97 for 'a'), we create the strings
maplist(maplist(atom_codes), L, [T1, T2, T3, T4, T5, T6] ),
maplist(writeln, L).
read_file(In, L, L1) :-
read_line_to_codes(In, W),
( W == end_of_file ->
% the file is read
L1 = L
;
% we sort the list of codes of the line
msort(W, W1),
% to create the key in alphabetic order
atom_codes(A, W1),
% and we have the pair Key-Value in the result list
read_file(In, [A-W | L], L1)).
% predicate for sorting list of pairs Key-Values
% if the lentgh of values is the same
% we sort the keys in alhabetic order
my_compare(R, K1-V1, K2-V2) :-
length(V1, L1),
length(V2, L2),
( L1 < L2 -> R = >; L1 > L2 -> R = <; compare(R, K1, K2)).

View file

@ -0,0 +1,22 @@
words <- readLines("http://www.puzzlers.org/pub/wordlists/unixdict.txt")
word_group <- sapply(
strsplit(words, split=""), # this will split all words to single letters...
function(x) paste(sort(x), collapse="") # ...which we sort and paste again
)
counts <- tapply(words, word_group, length) # group words by class to get number of anagrams
anagrams <- tapply(words, word_group, paste, collapse=", ") # group to get string with all anagrams
# Results
table(counts)
counts
1 2 3 4 5
22263 1111 155 31 6
anagrams[counts == max(counts)]
abel acert
"abel, able, bale, bela, elba" "caret, carte, cater, crate, trace"
aegln aeglr
"angel, angle, galen, glean, lange" "alger, glare, lager, large, regal"
aeln eilv
"elan, lane, lean, lena, neal" "evil, levi, live, veil, vile"

View file

@ -0,0 +1,6 @@
'(("neal" "lena" "lean" "lane" "elan")
("trace" "crate" "cater" "carte" "caret")
("regal" "large" "lager" "glare" "alger")
("elba" "bela" "bale" "able" "abel")
("lange" "glean" "galen" "angle" "angel")
("vile" "veil" "live" "levi" "evil"))

View file

@ -0,0 +1,21 @@
#lang racket
(require net/url)
(define (get-lines url-string)
(define port (get-pure-port (string->url url-string)))
(for/list ([l (in-lines port)]) l))
(define (hash-words words)
(for/fold ([ws-hash (hash)]) ([w words])
(hash-update ws-hash
(list->string (sort (string->list w) < #:key (λ (c) (char->integer c))))
(λ (ws) (cons w ws))
(λ () '()))))
(define (get-maxes h)
(define max-ws (apply max (map length (hash-values h))))
(define max-keys (filter (λ (k) (= (length (hash-ref h k)) max-ws)) (hash-keys h)))
(map (λ (k) (hash-ref h k)) max-keys))
(get-maxes (hash-words (get-lines "http://www.puzzlers.org/pub/wordlists/unixdict.txt")))

View file

@ -0,0 +1,10 @@
d := Dictionary new.
'unixdict.txt' asFilename
readingLinesDo:[:eachWord |
(d at:eachWord copy sort ifAbsentPut:[OrderedCollection new]) add:eachWord
].
((d values select:[:s | s size > 1])
sortBySelector:#size)
reverse
do:[:s | s printCR]

View file

@ -0,0 +1 @@
'http://www.puzzlers.org/pub/wordlists/unixdict.txt' asURI contents asCollectionOfLines do:[:eachWord | ...

View file

@ -0,0 +1,7 @@
list:= (FillInTheBlank request: 'myMessageBoxTitle') subStrings: String crlf.
dict:= Dictionary new.
list do: [:val|
(dict at: val copy sort ifAbsent: [dict at: val copy sort put: OrderedCollection new])
add: val.
].
sorted:=dict asSortedCollection: [:a :b| a size > b size].

View file

@ -0,0 +1,56 @@
:- use_module(library(lambda)).
:- use_module(library(clpfd)).
% Parameters of the server
% length of the guess
proposition(4).
% Numbers of digits
% 0 -> 8
digits(8).
bulls_and_cows_server :-
proposition(LenGuess),
length(Solution, LenGuess),
choose(Solution),
repeat,
write('Your guess : '),
read(Guess),
( study(Solution, Guess, Bulls, Cows)
-> format('Bulls : ~w Cows : ~w~n', [Bulls, Cows]),
Bulls = LenGuess
; digits(Digits), Max is Digits + 1,
format('Guess must be of ~w digits between 1 and ~w~n',
[LenGuess, Max]),
fail).
choose(Solution) :-
digits(Digits),
Max is Digits + 1,
repeat,
maplist(\X^(X is random(Max) + 1), Solution),
all_distinct(Solution),
!.
study(Solution, Guess, Bulls, Cows) :-
proposition(LenGuess),
digits(Digits),
% compute the transformation 1234 => [1,2,3,4]
atom_chars(Guess, Chars),
maplist(\X^Y^(atom_number(X, Y)), Chars, Ms),
% check that the guess is well formed
length(Ms, LenGuess),
maplist(\X^(X > 0, X =< Digits+1), Ms),
% compute the digit in good place
foldl(\X^Y^V0^V1^((X = Y->V1 is V0+1; V1 = V0)),Solution, Ms, 0, Bulls),
% compute the digits in bad place
foldl(\Y1^V2^V3^(foldl(\X2^Z2^Z3^(X2 = Y1 -> Z3 is Z2+1; Z3 = Z2), Ms, 0, TT1),
V3 is V2+ TT1),
Solution, 0, TT),
Cows is TT - Bulls.

View file

@ -0,0 +1,19 @@
target <- sample(1:9,4)
bulls <- 0
cows <- 0
attempts <- 0
while (bulls != 4)
{
input <- readline("Guess a 4-digit number with no duplicate digits or 0s: ")
if (nchar(input) == 4)
{
input <- as.integer(strsplit(input,"")[[1]])
if ((sum(is.na(input)+sum(input==0))>=1) | (length(table(input)) != 4)) {print("Malformed input!")} else {
bulls <- sum(input == target)
cows <- sum(input %in% target)-bulls
cat("\n",bulls," Bull(s) and ",cows, " Cow(s)\n")
attempts <- attempts + 1
}
} else {print("Malformed input!")}
}
print(paste("You won in",attempts,"attempt(s)!"))

View file

@ -0,0 +1,65 @@
;generate a random non-repeating list of 4 digits, 1-9 inclusive
(define (get-num)
(define (gen lst)
(if (= (length lst) 4) lst
(let ((digit (+ (random 9) 1)))
(if (member digit lst) ;make sure the new digit isn't in the
;list
(gen lst)
(gen (cons digit lst))))))
(string->list (apply string-append (map number->string (gen '())))))
;is g a valid guess (that is, non-repeating, four digits 1-9
;inclusive?)
(define (valid-guess? g)
(let ((g-num (string->number (apply string g))))
;does the same digit appear twice in lst?
(define (repeats? lst)
(cond ((null? lst) #f)
((member (car lst) (cdr lst)) #t)
(else (repeats? (cdr lst)))))
(and g-num
(> g-num 1233)
(< g-num 9877)
(not (repeats? g)))))
;return '(cows bulls) for the given guess
(define (score answer guess)
;total cows + bulls
(define (cows&bulls a g)
(cond ((null? a) 0)
((member (car a) g) (+ 1 (cows&bulls (cdr a) g)))
(else (cows&bulls (cdr a) g))))
;bulls only
(define (bulls a g)
(cond ((null? a) 0)
((equal? (car a) (car g)) (+ 1 (bulls (cdr a) (cdr g))))
(else (bulls (cdr a) (cdr g)))))
(list (- (cows&bulls answer guess) (bulls answer guess)) (bulls answer guess)))
;play the game
(define (bull-cow answer)
;get the user's guess as a list
(define (get-guess)
(let ((e (read)))
(if (number? e)
(string->list (number->string e))
(string->list (symbol->string e)))))
(display "Enter a guess: ")
(let ((guess (get-guess)))
(if (valid-guess? guess)
(let ((bulls (cadr (score answer guess)))
(cows (car (score answer guess))))
(if (= bulls 4)
(display "You win!\n")
(begin
(display bulls)
(display " bulls, ")
(display cows)
(display " cows.\n")
(bull-cow answer))))
(begin
(display "Invalid guess.\n")
(bull-cow answer)))))
(bull-cow (get-num))

View file

@ -0,0 +1,58 @@
Object subclass: BullsCows [
|number|
BullsCows class >> new: secretNum [ |i|
i := self basicNew.
(self isValid: secretNum)
ifFalse: [ SystemExceptions.InvalidArgument
signalOn: secretNum
reason: 'You need 4 unique digits from 1 to 9' ].
i setNumber: secretNum.
^ i
]
BullsCows class >> new [ |b| b := Set new.
[ b size < 4 ]
whileTrue: [ b add: ((Random between: 1 and: 9) displayString first) ].
^ self new: (b asString)
]
BullsCows class >> isValid: num [
^ (num asSet size = 4) & ((num asSet includes: $0) not)
]
setNumber: num [ number := num ]
check: guess [ |bc| bc := Bag new.
1 to: 4 do: [ :i |
(number at: i) = (guess at: i)
ifTrue: [ bc add: 'bulls' ]
ifFalse: [
(number includes: (guess at: i))
ifTrue: [ bc add: 'cows' ]
]
].
^ bc
]
].
'Guess the 4-digits number (digits from 1 to 9, no repetition)' displayNl.
|guessMe d r tries|
[
tries := 0.
guessMe := BullsCows new.
[
[
'Write 4 digits: ' display.
d := stdin nextLine.
(BullsCows isValid: d)
] whileFalse: [
'Insert 4 digits, no repetition, exclude the digit 0' displayNl
].
r := guessMe check: d.
tries := tries + 1.
(r occurrencesOf: 'bulls') = 4
] whileFalse: [
('%1 cows, %2 bulls' % { r occurrencesOf: 'cows'. r occurrencesOf: 'bulls' })
displayNl.
].
('Good, you guessed it in %1 tries!' % { tries }) displayNl.
'Do you want to play again? [y/n]' display.
( (stdin nextLine) = 'y' )
] whileTrue: [ Character nl displayNl ].

View file

@ -0,0 +1,7 @@
-- This is a line-comment
#
This is a block-comment
It goes until de-dent
dedent: 0x42 -- The comment block above is now closed

View file

@ -0,0 +1,2 @@
/* This is a
multi-line comment */

View file

@ -0,0 +1 @@
% this is a single-line comment that extends to the end of the line

View file

@ -0,0 +1 @@
# end of line comment

View file

@ -0,0 +1,2 @@
; this is a coment
#;(this expression is ignored)

View file

@ -0,0 +1 @@
-- a single line comment

Some files were not shown because too many files have changed in this diff Show more