Groups Images Directory Web
Recently Visited Groups | Help | Sign in
Google Groups Home
Group info
Members: 210
Language: English
Group categories:
Science and Technology
Computers
Schools and Universities
More group info »
Snorgers Code    

Snorgers Code

LICENCE

You may choose your licence as any GNU or MIT licence except for some special files which contains modified code from the Qi sources, in which the QiII licence should be applicable

Macro Package

Documentation and Code

macro.qi

Package

macro.tar.gz

Basic usage of defmacro

  (defmacro macroname Code -> list-expression)

Description

This package introduces a defmacro sugar function that is similar to lisp defmacro But evaluates the code from the inside and out meaning that in the list delivered to the macro there is no other macro forms. To note for macro developers is that the main an advantage to have it this way is that one can safely assume that (/. X Z) and (let X Y Z) forms are the only variable binding form. This assumption may not hold if variable binding typemacros are used though.

Simple Operators

Documentation and Code

simple-operators.qi

Package

simple.tar.gz

Dependencies

Depends on the macro package.

Basic usage

   (S1 ∪ S2)       := union of S1 and S2
(a ∈ B ⊂ C ∋ c) := is (a in B which is a subset of C which has element c) true?

Description

Infix set operators fare defined as well as a chained logical expression. A drawback is that < and > will cause buggs if they are used in code. Use of all binary operators cannot be mixed, use parenthesis - almost nobody know the precedence of them!

Pattern matching lambdas

Licence notes

fun.qi in the package containes code that is copied from QiII sources and therefore the Qi licence should hold for that file.

Documentation and Code

The main reference for the define lambda is fun.qi and a enhanced version of the define lambda is sfun.qi

Package

fun.tar.gz

Dependencies

Depends on the macro package and the simple-operator packages in that order.

Basic usage

Two basic constructs are defined, first an anonymous lambda that use pattern matching

  (fun A     b -> Code1
[1 a] B -> Code2)
and an enhanced version that is basically a rewrite of qi-yacc in a more functional patern matching form and a segment matcher.
  (sfun A           b -> Code1
[1 @L b |K] B -> Code2)

Description

Lambdas have a nice feature that they capture scoped variables. Lambdas is a part of Qi, but they are very close to the standard lambda in Lisp. Therefore it can be usefull to have an anonymous lambda that uses pattern matching as in define. the fun construct is such a creature. As a consequence of capturing variables new features have been coding into a fun construct called sfun. The features include segment pattern matching, a functional qi-yacc like feature, patching in values from the outer scope inside the matching part, quoting of symbols so that parsing of lisp constructs can be handled in a less clumsy way.

Issues

Qi is slightly patched, you can find it, qi::ebr in fun.qi. Using the extra features in let constructs and in match constructs can backfire if you are not careful with stateful functions. see fun1.qi.

Incremental loading

Licence notes

This package containes patterns from the reader.qi file and hence needs to be under the Qi license.

Package

inc-load.tar.gz

Description

This package patches the load function in qi to do true incremental loading of qi files.

Version: 
2 messages about this page
4 Aug 2009 by snorgers
Added a nice feature of a incremental loading version of the load
function
/Stefan

Click on http://groups.google.co.uk/group/Qilang/web/snorgers-code -
or copy & paste it into your browser's address bar if that doesn't
work.
31 July 2009 by snorgers
Here are my code contributions to the qi community collected on one
page.

For any comments, post it in this thread.

Also, note that if you just paste in html code into google pages it
will crash.
You need to go in and change the page artificially afterwords and then
save it.
Probably, because I pasted html previously the pages was deleted!!
Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google