Re: Construct sequences of URL-Strings - need help
Alexander Burger a...@software-lab.de writes: Hi Alex, isn't this what you mean? (de replaceUrlWildcard (U W) (let Y (split (chop U) *) (glue (mapcar '((X) (pack (car Y) X (cadr Y))) W ) ) ) ) (replaceUrlWildcard http://software-lab.de/doc/ref*.html; '(A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ) ) - http://software-lab.de/doc/refA.html http://software-lab.de/doc/refB.html ... Side note: Though the result of 'pack' is the same, I would recommend (cadr Y) instead of (cdr Y), to reflect the result of 'split'. An external program reads the URL's like this: ,-- | (setq UrlStrings_ref (prin \ (replaceUrlWildcard U_ref W_ref) \)) If you use 'print' instead of 'prin' here, you don't need to supply the double quotes yourself: : (print abc) abc- abc gives the same _output_ as : (prin \ abc \) abc- \ Yes, I don't where these 4 quotes come from - do they have a special meaning in Picolisp? I don't remember ... If the reader sees two double quotes in sequence, it returns NIL (representing the empty string) : (list a b) - (a NIL b) Therefore, read as two NILs : (list a b) - (a NIL NIL b) which in turn disappear in the 'pack' (pack '(a NIL NIL b)) - ab just for the record, this from your PM: ,-- | (de replaceUrlWildcard (U W) |(let Y (split (chop U) *) | (mapcar | '((X) (pack \ (car Y) X (cadr Y) \)) | W ) ) ) `-- and then: ,--- | (apply call |(replaceUrlWildcard Uxxx Wyyy) |pandoc -s -S -o /home/tj/picolisp-ref.org ) `--- did the job perfectly - thanks. -- cheers, Thorsten -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Structuring a GUI project to avoid stop - starts
Hi Konrad, If I'm understanding this correctly the simple way to do this is to put the logic for each page in its own file. so instead of (de report ..) I would have a report.l file that just contains the guts of what I'm coding. Right. The family demo program is not a good example for that, as it puts for simplicity everything into a single file, and uses functions for each object GUI frame instead of external files. A better example is the app/ demo. All our production apps follow this layout. There is a main.l which loads the system libraries, contains some global definitions, and loads app-specific er.l, lib.l and gui.l files. These files change rarely after the first version of the application is done. But if the model in er.l changes, it is better to stop the server, delete the database files, and start again (resulting in the execution of the init code). This is easier than doing the model changes in-memory, and editing the database to reflect the new structures. When lib.l (general utility functions) and gui.l (the menu structure dialogs, and other GUI related functions) change, I simply enter (load xxx/lib.l) in the REPL. Or I use (edit 'foo) followed by a (ld). 90 percent of the application code resides in object GUI forms (e.g. in the app/ demo these are role.l, user.l, sal.l, cusu.l, item.l and ord.l) and other pages (most typically reports or special actions like data im- and exports). For these files, nothing at all has to be done. I just reload the page in the browser. To keep some context in such files, I often use 'once' to avoid repeated code execution. Other 'load'ed code takes care to avoid repeated effects by using 'push1' instead of 'push' (as in e.g. lib/form.l and socialshareprivacy/lib.l) and similar measures. In that way I try to organize each file (except er.l) in such a way that it can be re-loaded at any time. Reloading model.l is not really an issue for me. Besides at the moment if it does change ir porably means that the underlying database also needs to be nerfed and recreated becasue I've made large changes to the the entity structures. THough this is not likely at this stage Exactly. Cheers, - Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Segfault on Linux Mint 12 x64
Hi Alex! I have Linux Mint 12 x64 (based on Ubuntu) on my laptop + picoLisp x64 ver. 3.0.9.4 (testing release) gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) I get segfault when I run ./dbg, then enter (traceAll) or (ht:Prin ) I tried strace: --- (traceAll) --- .. skipped ... write(1, \n, 1) = 1 open(lib/ext, O_RDONLY) = 3 read(3, \177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0P\t\0\0\0\0\0\0..., 832) = 832 fstat(3, {st_mode=S_IFREG|0775, st_size=6304, ...}) = 0 getcwd(/home/mtm/picoLisp, 128) = 19 mmap(NULL, 2101624, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f46b011b000 mprotect(0x7f46b011c000, 2093056, PROT_NONE) = 0 mmap(0x7f46b031b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7f46b031b000 close(3)= 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- Process 2893 detached - --- (ht:Prin ) --- .. skipped ... open(lib/ht, O_RDONLY)= 3 read(3, \177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\360\21\0\0\0\0\0\0..., 832) = 832 fstat(3, {st_mode=S_IFREG|0775, st_size=18608, ...}) = 0 getcwd(/home/mtm/picoLisp, 128) = 19 mmap(NULL, 2113920, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fab3867 mprotect(0x7fab38672000, 2097152, PROT_NONE) = 0 mmap(0x7fab38872000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7fab38872000 close(3)= 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- Process 2884 detached - The same version of PL works fine on CentOS 6.2 x64, so maybe that's not PL issue. If you have no idea about it at the moment, there is no big trouble, I can just migrate to CentOS. Regards, Mansur -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Segfault on Linux Mint 12 x64
Did you compile everything? Sometimes I've had problems with other binaries than PL itself (which I always compile on the given system) when I've just copied them. On Tue, Mar 6, 2012 at 5:26 PM, Mansur Mamkin mmam...@mail.ru wrote: Hi Alex! I have Linux Mint 12 x64 (based on Ubuntu) on my laptop + picoLisp x64 ver. 3.0.9.4 (testing release) gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) I get segfault when I run ./dbg, then enter (traceAll) or (ht:Prin ) I tried strace: --- (traceAll) --- .. skipped ... write(1, \n, 1) = 1 open(lib/ext, O_RDONLY) = 3 read(3, \177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0P\t\0\0\0\0\0\0.., 832) = 832 fstat(3, {st_mode=S_IFREG|0775, st_size=6304, ...}) = 0 getcwd(/home/mtm/picoLisp, 128) = 19 mmap(NULL, 2101624, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f46b011b000 mprotect(0x7f46b011c000, 2093056, PROT_NONE) = 0 mmap(0x7f46b031b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7f46b031b000 close(3) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- Process 2893 detached - --- (ht:Prin ) --- .. skipped ... open(lib/ht, O_RDONLY) = 3 read(3, \177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\360\21\0\0\0\0\0\0..., 832) = 832 fstat(3, {st_mode=S_IFREG|0775, st_size=18608, ...}) = 0 getcwd(/home/mtm/picoLisp, 128) = 19 mmap(NULL, 2113920, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fab3867 mprotect(0x7fab38672000, 2097152, PROT_NONE) = 0 mmap(0x7fab38872000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7fab38872000 close(3) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- Process 2884 detached - The same version of PL works fine on CentOS 6.2 x64, so maybe that's not PL issue. If you have no idea about it at the moment, there is no big trouble, I can just migrate to CentOS. Regards, Mansur -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Segfault on Linux Mint 12 x64
Hi Mansur, I have Linux Mint 12 x64 (based on Ubuntu) on my laptop + picoLisp x64 ver. 3.0.9.4 (testing release) gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) I get segfault when I run ./dbg, then enter (traceAll) or (ht:Prin ) I think I know. I saw the same on Ubuntun 11.10, and I think Mint is based on that. The Ubuntu package maintainers somehow messed up the linking, so that dynamic libraries are not correctly loaded. I debugged it with 'gdb' back then, and saw it crashed in dlopen() IIRC. The Debian versions (on which Unbuntu is based) always worked correctly. Please try Ubuntu 12.4 (preliminary version), or Debian testing, if possile. Cheers, - Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
PicoLisp assembler in JavaScript?
Hi, I noticed Rudy's recent article The Browser 'IS' The Data Base http://picolisp.com/5000/-2-22.html, re. a possible PicoLisp implementation based on node.js. Would it be an idea to first write a PicoLisp assembler (equivalent to the one used in 64-bits PL) in JavaScript, so one could rip off all (or most of) the assembly code that 64-bits PL is written in? It seems like it could be a fun thing to do, at least for those who have some time available ... ;-) /Jon -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: PicoLisp assembler in JavaScript?
On March 6, 2012 at 4:10 PM Jon Kleiser jon.klei...@usit.uio.no wrote: JavaScript, so one could rip off all (or most of) the assembly code that 64-bits PL is written in? It seems like it could be a fun thing to do, at least for those who have some time available ... ;-) I think it's a wonderful idea. Off topic: http://picolisp.com/5000/-2-22.html http://picolisp.com/5000/-2-22.html * how do I edit pages on that wiki? * I never understand under which topic an article belongs, which brings me to the URL, it would be nice if the URL reflected the topic of the Wiki page. best regards, Jakob -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: PicoLisp assembler in JavaScript?
Hi Jon, implementation based on node.js. Would it be an idea to first write a PicoLisp assembler (equivalent to the one used in 64-bits PL) in JavaScript, so one could rip off all (or most of) the assembly code that 64-bits PL is written in? It seems like it could be a fun thing to do, at least for those who have some time available ... ;-) Yes, it would indeed be fun. But I think very difficult. To have it run in the JavaScript environment, it would be necessary to bring the assembler to output JavaScript code, or to write an emulator of the PicoLisp machine (see http://software-lab.de/doc64/asm) in JavaScript. I spent a lot of time contemplating to write such an emulator in C, and finally gave up because there is no way to implement the 'native' function in C, which is the most interesting feature of pil64. In JavaScript it is probably even more difficult than in C. Cheers, - Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: PicoLisp assembler in JavaScript?
Hi Jakob, Off topic: http://picolisp.com/5000/-2-22.html http://picolisp.com/5000/-2-22.html * how do I edit pages on that wiki? You register, and then experiment with the help page. * I never understand under which topic an article belongs, which brings me to the URL, it would be nice if the URL reflected the topic of the Wiki page. Most URLs have names like http://picolisp.com/5000/!wiki?gsoc; or http://picolisp.com/5000/!wiki?ideasPage;. The problem with the above page is that it is a Reply which Rudy made to the GSoC page. Such replies have no title. BTW, Thorsten is now in the process of inserting Rudy's reply into the Ideas-Page, and then we'll probably can delete that reply. Cheers, - Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Google Summer of Code (GSoC) 2012
In any case, time is getting short: The Mentoring organization application deadline is 9th of march, that's three days from now. So if anybody has a proposal for an idea, (s)he should hurry to post it on the ideas page. Cheers, - Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe