Re: Stanza-window disappears in Windows 7


Problem still persisting.. no stanza today :(

going to sleep now - good night :)

Re: Stanza-window disappears in Windows 7


"file was downloaded incorrectly" for installation of all versions

niXman - 4 hours ago

Please redownload the mingw-w64-install.exe

Seems I was not the only one with that problem

Re: Stanza-window disappears in Windows 7


post scriptum:

Problem of "File downloaded incorrectly" still persists,

some of distros are dead links,

I downloaded a "working" distros file and placed it with installer in same folder and made sure the installer would choose it (so I thought) but no sir, still downloaded incorrectly :(

Re: Stanza-window disappears in Windows 7


Hi Ulli.

Sorry you're having such a rough time getting started! I think you're right that it's a problem with your MinGW installation. Can you verify that you visited: ? 

There are actually two separate MinGW projects. One is called MinGW, and one is called MinGW-w64. It is doubly confusing because the MinGW project actually has a 64-bit version as well. That's not the one you want. You want the actual project called MinGW-w64. 


Re: Stanza-window disappears in Windows 7


Your welcome !

The next issue could be a little more complicated, I'll just try having it answered here.

When compiling the example "helloworld.stanza" I get:

tmp3.s:876: Error: bad register name `%rsp)'
tmp3.s:877: Error: bad register name `%rsi'
tmp3.s:878: Error: bad register name `%rax'
tmp3.s:879: Error: bad register name `%rsp'
tmp3.s:882: Error: bad register name `%rsp'
tmp3.s:883: Error: missing or invalid immediate expression `4294967296'
tmp3.s:884: Error: bad register name^C

I guess it's an issue with mingw and the used architecture - it's stated you should use 64 bit, but while installing there's another point architecture which is on 686 by default

The linked mingw installation-routine is not working btw, it throws "The file has been downloaded incorrectly" when starting to download.

I got mingw via mingw-installation-manager

which was updated last time in 2013 hmmm....

Re: Stanza-window disappears in Windows 7


Hi Ulli.

That's interesting. It's good that you found a fix. I'll make a note of it in case anyone else runs into the same issues. Thanks for reporting it!


Re: Stanza-window disappears in Windows 7


Seems I should have explained better -

I already am in a command window (dos prompt) and run stanza from there, an additional command-window is opened.

I found the solution though: stanza.exe was configured to be run as administrator, once deactivated, it stays in the same cmd-window.

Thanks for your help anyway, now I can continue ^^

Re: Stanza-window disappears in Windows 7


Hi Ulli!

Glad to hear you're giving it a try. Stanza is currently designed to be run in a console application. The default one that comes with Windows is called Command Prompt. You can start it up by opening the Start Menu, and searching for Command Prompt. After it launches, you can navigate to your project directory using the "cd" command.

Let me know if you still have issues.


Stanza-window disappears in Windows 7


Hi there, I've been rubbernecking Stanza for some time now and finally found motivation to start,

yet when I try to make my first steps I notice I can not continue because the window that opens when calling Stanza under windows

only shows up for a moment, way too fast to be read by anybody.

I invested some time but could not find a solution -

I know this is a trivial problem, but it clearly creates an inhibition threshold for beginners.

The right way to do it, in my experience, is to run the exe in the same window as it was called from.

  Please, answer soon :) so I can continue my journey into stanza !

BEst regards

-Ulli Gerhard

Re: Regex support


Hey Yves,

The repository is at

The only function implemented so far is capturing text using regex. Considering that I didn't have enough time to thoroughly test it, I doubt that the code is bug-free. Still, I hope it would help you atleast a little. Splitting text using regex is coming up next - I have the code ready, but I am having trouble remembering how to do certain things in LoStanza (the doc for which can certainly use a few more examples). I will try to update the repo next week.

Hope this helps; feel free to poke me here whenever you want to.



Re: Regex support

Yves Cloutier

Hi Jake,

Sorry to hear about those challenging times,but great that you'll get back on the programming horse.

Essentially I need to be able to match and capture.  Below is the task at hand:

...This function will take a single string and return an array/list of all the tokens (strings) in it. The following regular expression (PCRE) will match all tokens.


  • For each match captured within the parenthesis starting at char 6 of the regular expression a new token will be created.

    • [\s,]*: Matches any number of whitespaces or commas. This is not captured so it will be ignored and not tokenized.

    • ~@: Captures the special two-characters ~@ (tokenized).

    • [\[\]{}()'`~^@]: Captures any special single character, one of []{}'`~^@ (tokenized).

    • "(?:\\.|[^\\"])*": Starts capturing at a double-quote and stops at the next double-quote unless it was proceeded by a backslash in which case it includes it until the next double-quote (tokenized).

    • ;.*: Captures any sequence of characters starting with ; (tokenized).

    • [^\s\[\]{}('"`,;)]*: Captures a sequence of zero or more non special characters (e.g. symbols, numbers, "true", "false", and "nil") and is sort of the inverse of the one above that captures special characters (tokenized).

  • What is your github btw?

    Re: Regex support


    Hey Yves,

    I had to stop working on my regex package due to a series of unfortunate events, but I am trying to get back into it now. My current package (which is on gitHub) only has a regex 'match' function, but a regex 'split' function wouldn't be particularly hard to cook up. Is that the functionality you are looking for?


    Re: Regex support

    Yves Cloutier

    Hi Jake,

    I'm wondering if you had continued working on PCRE for stanza, and if so if you wouldn't mind sharing?

    I'd like to try making a lisp following these steps:

    but the first steps in the process involve using regex :(

    Would love to give your implementation a try :)



    Re: Stanza Updates?

    Yves Cloutier

    Great! Thanks for the update Patrick. Will look out for a new version in the next couple weeks!

    For the homework I was trying to keep it as close to the ML version as possible, but I agree having a struct and being able to to something like month(head(dates)) reads much better.

    Re: Stanza Updates?


    Hi Yves.

    There are some exciting updates coming out this week actually. The Stanza separate compiler is done and allows for packages to be independently and separately compiled. This reduces compilation times by allowing you to recompile only the packages that have changed. This was a crucial piece of functionality to enable Stanza to be used for large projects.

    Thanks for posting your homework solution. Your code is very clean! 

    I, myself, prefer your solution of using a separate Date struct, but should the need arise in the future, you can specify a list of tuples as "List<[Int, Int, Int]>".

    Merry Christmas!


    Stanza Updates?

    Yves Cloutier

    Hi Patrick,

    I'll bet a few of us keep coming to the website to see what'sthe latest happenings going on with stanza.  Would it be possible to give a little update on how things are progressing?

    On another note, I'm taking a nice course on Coursera which covers ML, Racket and Ruby. I've been having some fun and trying to reproduce my homework answers in Stanza. Here's an example:

    ML Version
    (* Functon that takes a list of dates and a month. It returns the number of times the month specified occurs in the list of dates*)
    fun number_in_month(dates: (int*int*int) list, month:int) =
      if null dates (*edge case*)
      then 0
        if #2(hd(dates)) = month
        then 1 + number_in_month(tl dates, month)
        else 0 + number_in_month(tl dates, month)

    Stanza Version

    defstruct Date :

    defn number-in-month (dates:List<Date>, selected-month:Int) -> Int:
      if empty?(dates) :
      else :
        if month(head(dates)) == selected-month :
           1 + number-in-month(tail(dates), selected-month)
        else :
           0 + number-in-month(tail(dates), selected-month)

    I wasn't sure how to specify an argument of type "list of tuples" as in the ML version, so instead I ended up creating a struct and having the type be a List<Date>.

    A simple example, I know, but

    Re: Random Numbers?


    Hey Scott.

    For the macro system, you have to explicitly import the different productions individually. The hash, #, is the syntax for specifying a production. The following rule says that:

    defrule exp4 = (plus-three(?e:#exp))

    The pattern plus-three(?e:#exp) will match against call to plus-three containing a single expression argument. Within the body of the macro, the expression is bound to e. So the following forms are examples of forms that will match the pattern:

    plus-three(x + y)

    And here are some example forms that will not match.

    plus-three(x, y)
    plus-three(3 4)

    Stanza's coroutines are pretty powerful. The Game of Life should be a great match for it! 


    Re: Random Numbers?

    Scott Rostrup

    Thanks for that, that seems to work now, should have thought of trying that.  It's a little bit confusing that in the previous stanza programs I didn't have to explicitly list the imports from a package but for the macros you do (always?).  What is the interpretation of the hash, #, how should I read it?

    I'm helping facilitate global day of code retreat on Saturday, , I'll see if I can get some stanza takers :)

    Actually, someone did an interesting concurrent go implementation of the game of life using goroutines a few years back (, could be interesting to try with stanza's coroutines, hmm.  

    Re: Random Numbers?


    Oops. I forgot to import exp. Here's the fixed mymacros.stanza.

    defpackage mymacros :
      import core
      import macro-utils
      import stz/core-macros
    defsyntax mylang :
      import (exp, exp4) from core
      defrule exp4 = (plus-three(?e:#exp)) :
         val expanded = qquote(~ e + 3)
         parse-syntax[core / #exp](expanded)

    This is compiled using

    stanza tests/mymacros.stanza STANZADIR/stz-main.stanza -o exstanza

    to produce the extended compiler exstanza.

    And here's a sample program myprog.stanza that uses the new language.

    defn f (x:Int) :

    You can compile this program using

        exstanza myprog.stanza -o myprog

    And when you run myprog, it should print out


    Hope that helps!


    Re: Random Numbers?

    Scott Rostrup

    Thanks for the simple run down, this is exactly what I was looking for.  I did run into a snag trying to compile your demo, so with the exact code I hit this error,

    $ stanza mymacros.stanza ../../lbstanza/compiler/stz-main.stanza -o exstanza

    > In syntax package mylang: Could not resolve production exp.

    It's a bit confusing because I can see that exp is defined in the compiler/stz-core-macros.stanza file so I tried a few different variations of listing different files etc to no avail, it did however work if I changed the first `#exp` to `Int` in mymacros.stanza, but then the extended compiler failed on myprog.

    Could it be a version problem? I'm using the latest linux brew install (which worked really great btw), but the source code I was pointing at is from master on the github repo.



    121 - 140 of 273