q-lang-users Mailing List for Q - Equational Programming Language (Page 15)
Brought to you by:
agraef
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(3) |
Feb
(27) |
Mar
|
Apr
(4) |
May
(11) |
Jun
(5) |
Jul
(5) |
Aug
(6) |
Sep
(15) |
Oct
(28) |
Nov
(8) |
Dec
|
2005 |
Jan
(9) |
Feb
(5) |
Mar
(10) |
Apr
(43) |
May
(8) |
Jun
(31) |
Jul
(45) |
Aug
(17) |
Sep
(8) |
Oct
(30) |
Nov
(2) |
Dec
(6) |
2006 |
Jan
(4) |
Feb
(20) |
Mar
(1) |
Apr
|
May
(92) |
Jun
(179) |
Jul
(26) |
Aug
(65) |
Sep
(36) |
Oct
(38) |
Nov
(44) |
Dec
(68) |
2007 |
Jan
(11) |
Feb
(25) |
Mar
(37) |
Apr
(7) |
May
(83) |
Jun
(77) |
Jul
(44) |
Aug
(4) |
Sep
(28) |
Oct
(53) |
Nov
(12) |
Dec
(21) |
2008 |
Jan
(66) |
Feb
(45) |
Mar
(30) |
Apr
(50) |
May
(9) |
Jun
(18) |
Jul
(11) |
Aug
(6) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Albert G. <Dr....@t-...> - 2007-09-21 15:51:43
|
ed...@ri... wrote: > I saw that Q was using Qt 3? Yes, that's mainly because the current SmokeQt version, which is included with KDE, is still for Qt3. Of course I'm interested in getting Qt/Q to use Qt4 asap. But for the time being Qt3 is not going to go away (at least on Linux) since KDE and other apps still depend on it. I know that my SUSE Linux still shipped the Qt2 libraries for a long time after Qt3 was the thing already, to support legacy applications, and this time around it will not be different. When KDE4 is officially released and adopted by the major Linux distros, and the dust around it settles, then a Qt4/KDE4 version of QtSmoke should be available, too, and porting Qt/Q to the new version shouldn't be a big deal. (In fact I'm pretty sure that a SmokeQt version for Qt4 is already in the works, but I'll have to check this out.) Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: <ed...@ri...> - 2007-09-21 14:29:21
|
I saw that Q was using Qt 3?=0D =0D >From the Qt Website:=0D =0D With the release of Qt 4.0.0, Trolltech announced that the Qt 3 series woul= d=0D reach end of life status on July 1st, 2007. For those who have not yet ma= de the=0D upgrade to Qt 4, we provide a number of services, resources and tools to ea= se=0D your transition. =0D =0D Should Q GUI be changed to Qt 4?=0D =0D Eddie=0D =0D =0D =0D =0D =0D |
From: Albert G. <Dr....@t-...> - 2007-09-19 10:02:52
|
Tim Haynes wrote: > Wow, cool. Just in time. I was already thinking of writing such a UI > (retro? How dare you!) for something here, and of course wanted to do it in > Q if possible. Give me some weeks :) Great, I'm looking foward to it! If you prefer a q-ncurses tarball over cvs, so that you don't have to swigify the module yourself, I can send you one. There's a couple of examples in the q-ncurses package for your perusal, and if you want, I can also send you a little, but complete Q program using ncurses which I wrote for my Zaurus (it's a little text mode frontend for mplayer which also works for "big" Linux systems). > QT might be over my head but I'll have a look when it's properly out, for > sure :) Qt isn't all that difficult using Q. In fact, the whole signal/slot thing seems to be much easier than in C++. ;-) And with QtDesigner you can get a Qt/Q application up and running in a matter of minutes... If I have the time, I'll write a tutorial for the wiki, but for the time being you can take a look at the new dialog.q/dialog.ui example in cvs: http://q-lang.cvs.sourceforge.net/q-lang/qt-q/examples/ Cheers, Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Albert G. <Dr....@t-...> - 2007-09-19 09:09:06
|
Hi Tim, > Did I say I was spodzone? If not... I am :) Ok, you're added. Just remember that you *first* log into your sf.net account *before* you navigate to the wiki, otherwise you won't be granted write access to the wiki even though you have it. (At least it used to be that way. Haven't checked whether they fixed that bug yet.) Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Tim H. <q...@st...> - 2007-09-18 14:15:03
|
Albert Graef <Dr....@t-...> writes: > Ok, I've switched the wiki to "protected" now, and everybody who sent me > his sf.net id is now a q-lang project member with wiki write access. > (That's the only way to become a wiki member. If you don't like being > listed as a project member, I can remove you again, but then you can't > edit the wiki either.) Did I say I was spodzone? If not... I am :) > If anyone needs admin access to the wiki (I guess that you need that, > e.g., for editing the stylesheets) just let me know. ~Tim -- <http://spodzone.org.uk/> |
From: Tim H. <q...@st...> - 2007-09-18 13:52:46
|
Albert Graef <Dr....@t-...> writes: > Hi all, > > I set out to send a preliminary announcement already last week, but my > mails to the list kept bouncing back. That seems to be fixed now, so here > goes... > > New stuff in cvs: > > 1. q-ncurses provides an interface to the ncurses library. This is a full > ncurses wrapper, including support for the panel, menu and form > libraries, so if you always wanted to write Yet Another Emacs Clone(TM) > or program some wonderful retro text "GUIs", you can finally do that in Q > now. Browse the source code in cvs here: > http://q-lang.cvs.sourceforge.net/q-lang/q-ncurses/ Wow, cool. Just in time. I was already thinking of writing such a UI (retro? How dare you!) for something here, and of course wanted to do it in Q if possible. Give me some weeks :) QT might be over my head but I'll have a look when it's properly out, for sure :) ~Tim -- <http://spodzone.org.uk/> |
From: Albert G. <Dr....@t-...> - 2007-09-17 23:04:35
|
ed...@ri... wrote: > I like Qt as well. But, before you jump all over it, Too late. :) I still have some final polishing to do, but I'd say that Qt/Q is about 99% finished now. You see, most of the hard stuff has already been done by the SmokeQt ppl. What I'm doing is just wrapping it all up in a nice Q module and adding some convenience functions to make some things easier. BTW, the widget factory interface is also in cvs now, so you can now readily create applications directly from QtDesigner .ui files (or strings which contain the XML code), with just a single function call. > have you considered IUP? Nope, didn't hear about it yet. How does it measure up to wxWidgets? I believe you when you say that it's easy to use, but the screenshots at their website look quite awful, not really better than Tk which Q already supports as a simple portable GUI toolkit. OTOH Qt also works on Unix, Windows and OSX, looks quite nice and consistent everywhere (well, anything but native Aqua looks kind of outlandish on OSX, of course) and is really easy to program with. > I'm really looking forward to the "where" bug fix. Yes, I've also run into that annoying bug a couple of times already, so you can be sure that this is the next thing I am going to deal with. ;-) > I may have found > another bug but I haven't had time to pinpoint the problem. It occured > during an ODBC query, but I was under pressure for data so I modified > the old Python program :( At some point, I want to figure out what went > wrong. Please do. All bug reports are very much appreciated! Cheers, Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: <ed...@ri...> - 2007-09-17 12:52:31
|
<p>Albert! It's great to hear from you!<br /><br />I like Qt as well. But, = before you jump all over it, have you considered IUP? I played around with = it with Lua and it seems easy to get stuff going quickly AND it is written = in straight C so it should be easy to interface Q with. The only disadvanta= ge IMHO: they are still writting, but promising, a driver for Mac OS.<br />= </p><p>I'm really looking forward to the "where" bug fix. I may h= ave found another bug but I haven't had time to pinpoint the problem. It oc= cured during an ODBC query, but I was under pressure for data so I modified= the old Python program :( At some point, I want to figure out what went wr= ong.</p><p> Eddie<br /> <br /><br /><strong>On Sun Sep 16 9:44 , Albe= rt Graef sent:<br /><br /></strong><blockquote style=3D"border-left: 2px s= olid rgb(245, 245, 245); margin-left: 5px; margin-right: 0px; padding-left:= 5px; padding-right: 0px;">Hi all,<br />=0D <br />=0D I set out to send a preliminary announcement already last week, but my<br /= >=0D mails to the list kept bouncing back. That seems to be fixed now, so<br />= =0D here goes...<br />=0D <br />=0D New stuff in cvs:<br />=0D <br />=0D 1. q-ncurses provides an interface to the ncurses library. This is a<br />= =0D full ncurses wrapper, including support for the panel, menu and form<br />= =0D libraries, so if you always wanted to write Yet Another Emacs Clone(TM)<br = />=0D or program some wonderful retro text "GUIs", you can finally do t= hat in<br />=0D Q now. Browse the source code in cvs here:<br />=0D <a target=3D"_blank" href=3D"../parse.pl?redirect=3Dhttp%3A%2F%2Fq-lang.cvs= .sourceforge.net%2Fq-lang%2Fq-ncurses%2F">http://q-lang.cvs.sourceforge.net= /q-lang/q-ncurses/</a><br />=0D <br />=0D 2. Qt/Q (pronounced "cutie-cue") is a full wrapper of Trolltech's= <br />=0D well-known GUI toolkit (and, optionally, KDE), based on Perl's SmokeQt<br /= >=0D library (<a target=3D"_blank" href=3D"../parse.pl?redirect=3Dhttp%3A%2F%2Fp= erlqt.sourceforge.net%29.">http://perlqt.sourceforge.net\).</a> I've not te= sted this very much<br />=0D yet, and there is still some stuff to do (e.g., a ui->Q compiler so that= <br />=0D Qt/Q GUIs can be prototyped in QtDesigner), but the Q->Qt interface<br /= >=0D itself is finished and should be quite useful already. See<br />=0D <a target=3D"_blank" href=3D"../parse.pl?redirect=3Dhttp%3A%2F%2Fq-lang.cvs= .sourceforge.net%2Fq-lang%2Fqt-q%2F">http://q-lang.cvs.sourceforge.net/q-la= ng/qt-q/</a><br />=0D <br />=0D Moreover, I've also updated gqbuilder for the latest Gnocl version<br />=0D (GTK/Gnome on Tcl library, see <a target=3D"_blank" href=3D"../parse.pl?red= irect=3Dhttp%3A%2F%2Fgnocl.sf.net%29%2C">http://gnocl.sf.net\),</a> which i= s now also<br />=0D supposed to work on Windows (I've not tested it there yet, though). See<br = />=0D <a target=3D"_blank" href=3D"../parse.pl?redirect=3Dhttp%3A%2F%2Fq-lang.cvs= .sourceforge.net%2Fq-lang%2Fgqbuilder%2F">http://q-lang.cvs.sourceforge.net= /q-lang/gqbuilder/</a><br />=0D <br />=0D Still no news on that annoying 'where' bug that Eddie reported yet, but<br = />=0D I'm planning to fix that this week. Probably later this month there will<br= />=0D then be a bugfix release Q 7.8, along with initial releases of the new<br /= >=0D modules.<br />=0D <br />=0D Enjoy! :)<br />=0D Albert<br />=0D <br />=0D -- <br />=0D Dr. Albert Gr"af<br />=0D Dept. of Music-Informatics, University of Mainz, Germany<br />=0D Email: <a href=3D"javascript:top.opencompose('Dr....@t-...','','',= '')">Dr....@t-...</a>, <a href=3D"javascript:top.opencompose('ag@mu= wiinfa.geschichte.uni-mainz.de','','','')">ag...@mu...schichte.uni-mainz= .de</a><br />=0D WWW: <a target=3D"_blank" href=3D"../parse.pl?redirect=3Dhttp%3A%2F%2Fww= w.musikinformatik.uni-mainz.de%2Fag">http://www.musikinformatik.uni-mainz.d= e/ag</a><br />=0D <br />=0D -------------------------------------------------------------------------<b= r />=0D This SF.net email is sponsored by: Microsoft<br />=0D Defy all challenges. Microsoft(R) Visual Studio 2005.<br />=0D <a target=3D"_blank" href=3D"../parse.pl?redirect=3Dhttp%3A%2F%2Fclk.atdmt.= com%2FMRT%2Fgo%2Fvse0120000070mrt%2Fdirect%2F01%2F">http://clk.atdmt.com/MR= T/go/vse0120000070mrt/direct/01/</a><br />=0D _______________________________________________<br />=0D q-lang-users mailing list<br />=0D <a href=3D"javascript:top.opencompose('q-l...@li...',= '','','')">q-l...@li...</a><br />=0D <a target=3D"_blank" href=3D"../parse.pl?redirect=3Dhttps%3A%2F%2Flists.sou= rceforge.net%2Flists%2Flistinfo%2Fq-lang-users">https://lists.sourceforge.n= et/lists/listinfo/q-lang-users</a><br />=0D </blockquote>=0D </p><BR>= |
From: Albert G. <Dr....@t-...> - 2007-09-16 14:41:28
|
Hi all, I set out to send a preliminary announcement already last week, but my mails to the list kept bouncing back. That seems to be fixed now, so here goes... New stuff in cvs: 1. q-ncurses provides an interface to the ncurses library. This is a full ncurses wrapper, including support for the panel, menu and form libraries, so if you always wanted to write Yet Another Emacs Clone(TM) or program some wonderful retro text "GUIs", you can finally do that in Q now. Browse the source code in cvs here: http://q-lang.cvs.sourceforge.net/q-lang/q-ncurses/ 2. Qt/Q (pronounced "cutie-cue") is a full wrapper of Trolltech's well-known GUI toolkit (and, optionally, KDE), based on Perl's SmokeQt library (http://perlqt.sourceforge.net). I've not tested this very much yet, and there is still some stuff to do (e.g., a ui->Q compiler so that Qt/Q GUIs can be prototyped in QtDesigner), but the Q->Qt interface itself is finished and should be quite useful already. See http://q-lang.cvs.sourceforge.net/q-lang/qt-q/ Moreover, I've also updated gqbuilder for the latest Gnocl version (GTK/Gnome on Tcl library, see http://gnocl.sf.net), which is now also supposed to work on Windows (I've not tested it there yet, though). See http://q-lang.cvs.sourceforge.net/q-lang/gqbuilder/ Still no news on that annoying 'where' bug that Eddie reported yet, but I'm planning to fix that this week. Probably later this month there will then be a bugfix release Q 7.8, along with initial releases of the new modules. Enjoy! :) Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Albert G. <Dr....@t-...> - 2007-09-16 13:38:03
|
Just a test to see whether my mail still bounces back. -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Albert G. <Dr....@t-...> - 2007-08-17 09:08:42
|
Ok, I'll put this on the TODO list, too. Thanks, Albert ed...@ri... wrote: > Hello Albert: > > code: > > #!/usr/local/bin/q -cmain > > main ARGS = write ARGS > > > > If you forget to put a ";" at the end, you get the following error > > *** glibc detected *** /usr/local/bin/qc: malloc(): memory corruption: > 0xb7e4cd7 > 5 *** > ======= Backtrace: ========= > /lib/i686/cmov/libc.so.6[0xb7d715c6] > /lib/i686/cmov/libc.so.6[0xb7d727f3] > /lib/i686/cmov/libc.so.6(realloc+0x106)[0xb7d749f6] > /usr/local/bin/qc[0x80501b8] > /usr/local/bin/qc[0x805037d] > /usr/local/bin/qc[0x80519a5] > /usr/local/bin/qc[0x804a7fa] > /usr/local/bin/qc[0x804dd01] > /lib/i686/cmov/libc.so.6(__libc_start_main+0xe0)[0xb7d1d050] > /usr/local/bin/qc[0x8049561] > ======= Memory map: ======== > 08048000-0806a000 r-xp 00000000 03:01 485641 /usr/local/bin/qc > > ... > > > > Eddie > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > q-lang-users mailing list > q-l...@li... > https://lists.sourceforge.net/lists/listinfo/q-lang-users -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Albert G. <Dr....@t-...> - 2007-08-17 09:07:16
|
Hi Eddie, again thanks for the report, and sorry for being so unresponsive. I'm currently on vacation, so it may take a little while before I can look into this, but it's the first item on my TODO list, promised. Albert ed...@ri... wrote: > Hello Albert. > > This bug is related to the one posted earlier. > > code: > > def Month > = dict ["01","JAN"; "02","FEB"; "03","MAR"; "04","APR"; > "05","MAY"; "06","JUN"; "07","JUL"; "08","AUG"; > "09","SEP"; "10","OCT"; "11","NOV"; "12","DEC"]; > > // convert YYYY-MM-DD to DD-MON-YYYY > convertdate Date > where L = split "-" Date: > = " " if null L; > = sprintf "%2s-%3s-%4s" (L!2, Month!(L!1), L!0) otherwise; > > > ==> convertdate "1964-11-19" > sprintf "%2s-%3s-%4s" ("19",["1964","11","19"]!"11","1964") > > > ? Month mysteriously changed to ["1964","11","19"] which is really L. > > Eddie > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > q-lang-users mailing list > q-l...@li... > https://lists.sourceforge.net/lists/listinfo/q-lang-users > -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: <ed...@ri...> - 2007-08-17 08:59:32
|
<p>Hello Albert:</p><p>code:</p><p> #!/usr/local/bin/q -cmain</p><p>&n= bsp;main ARGS =3D write ARGS</p><p> </p><p>If you forget to put = a ";" at the end, you get the following error</p><p> *** gli= bc detected *** /usr/local/bin/qc: malloc(): memory corruption: 0xb7e4cd7<b= r />5 ***<br />=3D=3D=3D=3D=3D=3D=3D Backtrace: =3D=3D=3D=3D=3D=3D=3D=3D=3D= <br />/lib/i686/cmov/libc.so.6[0xb7d715c6]<br />/lib/i686/cmov/libc.so.6[0x= b7d727f3]<br />/lib/i686/cmov/libc.so.6(realloc+0x106)[0xb7d749f6]<br />/us= r/local/bin/qc[0x80501b8]<br />/usr/local/bin/qc[0x805037d]<br />/usr/local= /bin/qc[0x80519a5]<br />/usr/local/bin/qc[0x804a7fa]<br />/usr/local/bin/qc= [0x804dd01]<br />/lib/i686/cmov/libc.so.6(__libc_start_main+0xe0)[0xb7d1d05= 0]<br />/usr/local/bin/qc[0x8049561]<br />=3D=3D=3D=3D=3D=3D=3D Memory map:= =3D=3D=3D=3D=3D=3D=3D=3D<br />08048000-0806a000 r-xp 00000000 03:01 485641= /usr/local/bin/qc</p><p>...</p><p> </p><p>Edd= ie </p><p> =0D </p><BR>= |
From: <ed...@ri...> - 2007-08-16 01:43:04
|
Hello Albert.=0D =0D This bug is related to the one posted earlier.=0D =0D code:=0D =0D def Month =0D =3D dict ["01","JAN"; "02","FEB"; "03","MAR"; "04","APR";=0D "05","MAY"; "06","JUN"; "07","JUL"; "08","AUG";=0D "09","SEP"; "10","OCT"; "11","NOV"; "12","DEC"];=0D =0D // convert YYYY-MM-DD to DD-MON-YYYY=0D convertdate Date=0D where L =3D split "-" Date:=0D =3D " " if null L;=0D =3D sprintf "%2s-%3s-%4s" (L!2, Month!(L!1), L!0) otherwise;=0D =0D =0D =3D=3D> convertdate "1964-11-19"=0D sprintf "%2s-%3s-%4s" ("19",["1964","11","19"]!"11","1964")=0D =0D =0D ? Month mysteriously changed to ["1964","11","19"] which is really L.=0D =0D Eddie=0D =0D |
From: Albert G. <Dr....@t-...> - 2007-07-27 18:44:35
|
ed...@ri... wrote: > xr L > where A = 4, B = 2: > = \Z . A + B * Z; > > ==> xr [1,2] > \2 . 4+2*2 Hmm yes, the compiler clearly generates wrong code there. I'll look into this asap, thanks for reporting! Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: <ed...@ri...> - 2007-07-26 16:07:05
|
Hi Albert!=0D =0D code:=0D =0D xr L=0D where A =3D 4, B =3D 2:=0D =3D \Z . A + B * Z;=0D =0D =3D=3D> xr [1,2]=0D \2 . 4+2*2=0D =0D What happended to Z?=0D =0D Eddie=0D =0D |
From: Albert G. <Dr....@t-...> - 2007-07-11 23:50:52
|
Abram Clark wrote: > Just for the sake of example, is it possible to define > lambda within Q (pretend it wasn't a built-in). Perhaps this > is possible using special forms? Yes. In fact, lambda used to be defined in the standard library in earlier releases, and you can still find the old implementation in examples/lambda.q. One way to implement simple lambdas (without pattern-matching on arguments) uses the S, K and I combinators of the combinator calculus (http://en.wikipedia.org/wiki/Combinatory_logic). Here is a toy implementation, straight from the manual (see Section 7.1). This only works with simple kinds of Q expressions (Q's special forms and functions with side effects complicate matters, see examples/lambda.q), but conveys the basic idea. special lambda X Y; lambda X X = _I; lambda X (Y Z) = _S (lambda X Y) (lambda X Z); lambda X Y = _K Y otherwise; _I X = X; // identity function _K X Y = X; // constant function _S X Y Z = X Z (Y Z); // argument dispatching Example: ==> lambda X (2*X) _S (_S (_K (*)) (_K 2)) _I ==> _ 21 42 If you want to make sure that nested lambdas (which are needed, e.g., for multi-argument lambdas) are expanded recursively, you should also add the following equation before the other rules: lambda X (lambda Y Z) = lambda X ~(lambda Y Z); Example: ==> lambda X (lambda Y (Y/X)) _S (_S (_K _S) (_S (_S (_K _S) (_S (_K _K) (_K (/)))) (_K _I))) (_S (_K _K) _I) ==> _ 2 1 0.5 As you can see, the problem with this approach is that combinator expressions even for simple lambda terms can get pretty large. More elaborate implementations also employ Schoenfinkel's B and C combinators, which dispatch arguments only into the right and left subterm of an application, respectively. IIRC, this reduces the resulting combinator expression sizes to O(N^2) where N is the size of the lambda body. _B X Y Z = X (Y Z); _C X Y Z = (X Z) Y; // optimization rules: _S (_K X) (_K Y) = _K (X Y); _S (_K X) _I = X; _S (_K X) Y = _B X Y; _S X (_K Y) = _C X Y; Now you get: ==> lambda X (2*X) (2*) ==> lambda X (lambda Y (Y/X)) _C (/) ==> _ A B B/A But even with all those optimizations, the sizes of combinator expressions still grow exponentially with the number of nested lambdas in the worst case. It's possible to work around this with so-called supercombinators (which essentially amounts to introducing a bunch of temporary functions through a process called "lambda lifting"), but this requires preprocessing of the lambda expression. Cheers, Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Abram C. <ab...@at...> - 2007-07-10 12:23:36
|
Just for the sake of example, is it possible to define lambda within Q (pretend it wasn't a built-in). Perhaps this is possible using special forms? -Abram PS: Thanks to Albert for immediately providing a basic vim mode for Q. I have been using it. |
From: Albert G. <Dr....@t-...> - 2007-07-08 22:12:18
|
Albert Graef wrote: > sin_osc [] = sin_osc 440; Oops, that should have been: sin_osc [] = sin_osc [440]; -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Soenke H. <sh...@cs...> - 2007-07-06 22:07:26
|
> Also, IIRC, there's already some Lisp or Scheme package which > implements something along these lines, maybe it could be ported to Q. Here's an overview about other systems using SuperCollider. I don't know if= =20 it's up to date though: http://swiki.hfbk-hamburg.de:8888/MusicTechnology/659 S=F6nke |
From: Albert G. <Dr....@t-...> - 2007-07-06 20:04:57
|
Hi Christophe, and welcome to the list! christophe mckeon gonzalez de leon wrote: > here is my attempt to write a function which accepts > multiple parameters and which allows for defaults. i did > it this way because as far as i can tell, in Q you can't > have pattern matching based on the number of arguments > but only on the type and structure of arguments, correct? Well, are you familiar with curried functions? "Curried" and "variadic" don't go well together. That's because foo X Y = (foo X) Y, so if you write something like foo X Y = bar2 X Y; foo X = bar X; then the first equation will never be used because the subexpression foo X of foo X Y already matches the second equation, and an equation like foo = foo 1 2; will even go into an infinite loop on the foo subterm on the rhs. That's just how curried functions work. Curried functions are extremely useful since you can easily create new functions from them through partial applications. But if you need a variadic function (no matter whether it's actually a constructor or a defined function) then you're better off using a function which just takes a single tuple or list argument. E.g., foo [] = foo [1,2]; // supply defaults will work ok. You can also make foo a constructor "with equations" if you omit the 'const' attribute: type Foo = foo ARGS; foo [] = foo [1,2]; // supply defaults So, for your application you could probably use something like: type UGen; type SinOsc : UGen = sin_osc ARGS /* [FREQ,PHASE] */; sin_osc [] = sin_osc 440; sin_osc [FREQ] = sin_osc [FREQ,0]; That's how optional arguments are usually handled in Q's library (normally using tuples instead of lists, but I use lists here, since they're a little easier to deal with algorithmically). However, this approach might still get a bit unwieldy in the case of ugen descriptions, since some ugens have lots of parameters and you don't want to remember the order in which these have to be supplied. While Q doesn't have built-in "keyword arguments", Q's "grouping syntax" allows you to write something like sin_osc [freq,440;phase,0] which is just a shortcut for sin_osc [(freq,440),(phase,0)] So you could declare, say: type UGenArg = const freq, phase; // add more arg selectors here type UGen; type SinOsc : UGen = sin_osc ARGS /* [freq,F;phase,P] */; You'll then have to provide some logic to handle the defaults, but using dictionaries it is quite easy to do this in a generic manner, e.g.: defaults DFLTS ARGS = list (foldl insert (dict DFLTS) ARGS); For instance: ==> defaults [freq,440;phase,0] [] [(freq,440),(phase,0)] ==> defaults [freq,440;phase,0] [freq,220;] [(freq,220),(phase,0)] Voila, there you have your parameter lists with defaults filled in, nicely packaged and ready to processed by an SCLang code generator. ;-) > my other question is whether anybody has done any work > on making it possible to write SC synthdefs natively in Q? Well, I've thought about this. It would be *very* useful to have some high-level API to create binary SC synthdef files, but I never got round to doing this. Note that sclang and scsynth interfaces are already there (see the q-synth package), so the API could just churn out SCLang code instead of going all the way down to SuperCollider's binary synthdef format. Also, IIRC, there's already some Lisp or Scheme package which implements something along these lines, maybe it could be ported to Q. HTH, Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: christophe m. g. de l. <chr...@gm...> - 2007-07-05 17:09:49
|
hello everybody, total newb so bear with me. here is my attempt to write a function which accepts multiple parameters and which allows for defaults. i did it this way because as far as i can tell, in Q you can't have pattern matching based on the number of arguments but only on the type and structure of arguments, correct? type UGen; type SinOsc : UGen = const t_sinosc Freq Phase; type UGenDefaultArg = const default X; type UGenGivenArg = const given X; sinosc = t_sinosc (default 440) (default 0); (t_sinosc _:UGenDefaultArg Phase:UGenDefaultArg) Freq = t_sinosc (given Freq) Phase; (t_sinosc Freq:UGenGivenArg _:UGenDefaultArg) Phase = t_sinosc Freq (given Phase); so now one can write sinosc -> (t_sinosc (default 440) (default 0)) sinosc 220 -> (t_sinosc (given 220) (default 0)) sinosc 220 3.14159 -> (t_sinosc (given 220) (given 3.14159)) it is quite cumbersome and could be made much easier to write using macros, but i'm just wondering if this sort of thing would be frowned upon and if i am better off just writing a function which accepts a list instead, where notational convenience is sacrificed to a simpler and probably more idiomatic implementation. any hints? my other question is whether anybody has done any work on making it possible to write SC synthdefs natively in Q? regards, _c |
From: christophe m. g. de l. <chr...@gm...> - 2007-07-05 16:17:51
|
this might be worth a look: http://www.geocities.jp/kosako3/oniguruma/ http://en.wikipedia.org/wiki/Oniguruma cheers, _c On 7/3/07, Albert Graef <Dr....@t-...> wrote: > > Keith Trenton wrote: > > Thanks for answering my question so thoroughly! I should have kept that > query *purely* rhetorical, and by extension, to myself. ;-) > > Please don't. I'm sorry if my reply sounded a bit snappish; that wasn't > my intention. > > Maybe the following quote is relevant to this discussion. :) > > "Just because the standard provides a cliff in front of you, you are not > necessarily required to jump off it." Norman Diamond > > I agree that a scripting language (even if it's a functional one) ought > to have good support for them, and POSIX regexes certainly aren't the > pinnacle. I'll see what I can do about it, but I stand by my opinion > that a pcre module can (at least at first) be provided as an add-on; we > can always migrate it to the core later, once all backwards > compatibility issues have become non-problems. > > Cheers, > Albert > > -- > Dr. Albert Gr"af > Dept. of Music-Informatics, University of Mainz, Germany > Email: Dr....@t-..., ag...@mu... > WWW: http://www.musikinformatik.uni-mainz.de/ag > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > q-lang-users mailing list > q-l...@li... > https://lists.sourceforge.net/lists/listinfo/q-lang-users > |
From: Albert G. <Dr....@t-...> - 2007-07-05 13:37:12
|
Ok, this is my latest version. Still very simple, but this now does roughly the same highlighting as the Kate mode. I'm not sure about the 'sync' settings, though, you might wish to tune that. Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Rob H. <hub...@gm...> - 2007-07-05 11:54:20
|
Hello Abram, Alternatively, you could use defs with lambdas in the interpreter: ==> def Square = \X . X * X ==> Square 3 9 What Albert has described is superior though, and is the way you'd normally use Q. My suggestion may come in handy sometimes when you want to just try something quickly. By the way, if you wish to repeatedly try the same "commands", or rather evaluations, on your source, you can also put those in a separate "source" file [somewhat confusing terminology perhaps]. I usually use a <.qs> extension for these. So, <square.q> would contain (amongst your many other equations or definitions) square X = X * X; whilst the file <square.qs> might contain lines such as square 3; square 0; square (-1); Then in a command shell, you'd issue the command q square.q --source=square.qs or q square.q -s square.qs to run the interpreter on you files. To open the interpreter from the shell with you file pre-loaded, you'd probably just use q square.q I hope that helps to clarify things, and doesn't add to your confusion... [I can remember being a little confused by the separate interpreter command language when I first came across Q.] Rob. On 05/07/07, Albert Graef <Dr....@t-...> wrote: > Abram wrote: > > ==> square X = X * X; > > The interpreter only accepts expressions to evaluate. So '=' will be > interpreted as the equality operator here (which isn't by default > defined on symbolic expressions, hence the expression 'square X=X*X' is > in normal form). > > To enter a script with definitions, you must save it to a file and load > it with the interpreter (similar to Hugs or ghci). For instance: > > ==> edit square.q > > <<enter the script in vi and save it>> > > ==> run square.q > > ==> square 3 > 9 > > Albert |