Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Darth_Severus

#1
newLISP and the O.S. / Re: I/O error
February 18, 2016, 10:52:43 AM
Thanks ralf, this was a good idea. I should have had that thought on my own. Next time I'm trying strace. However, my computer froze and I had to restart. Now it is working.
#2
newLISP and the O.S. / I/O error
February 17, 2016, 04:52:37 AM
Hi,



I'm recently getting an I/O error when trying to start newLisp:


Quote$ /usr/bin/newlisp



ERR: I/O error


I didn't change anything, it just happend. Didn't try a new install so far. Any ideas why this happend?


Quote$ file /usr/bin/newlisp

/usr/bin/newlisp: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.26, BuildID[sha1]=6e58352d03112cf6cf1deb50fc8186415bf68610, stripped


QuoteCPU~Dual core Intel Core2 Duo U7600 (-MCP-) speed/max~800/1201 MHz Kernel~3.14-0.bpo.2-686-pae i686 Up~5 days Mem~620.3/999.6MB
#3
newLISP and the O.S. / Re: redirecting stderr not working
December 29, 2015, 04:20:44 PM
Many thanks, it works for me now how it should. I think I did something wrong somewhere.

However, the idea with redirecting it to stdout and then using the output in newlisp can be helpfull in other cases. I'm gonna keep that in mind.
#4
newLISP and the O.S. / redirecting stderr not working
December 23, 2015, 04:24:27 AM
$ mocp 2>/dev/null

Running the server...

Trying OSS...



$ mocp &>/dev/null

$



$ newlisp -e "(exec {mocp -i 2>/dev/null})"

()

$



Using (exec {mocp -i 2>/dev/null}) or (exec {mocp -i &>/dev/null}) in a script, I'm getting errors in the bash which is calling the script, even when I call the script with & at the end. Version: newLISP v.10.6.2 32-bit on Linux IPv4/6 UTF-8 libffi.
#5
It's based on Debian 8.2
#6
Quote from: "TedWalther"Which version of Linux?

MX Linux (32 Bit)

3.14-0.bpo.2-686-pae #1 SMP Debian 3.14.15-2~bpo70+1 (2014-08-21) i686 GNU/Linux



@ralf: The string needs to be in printf, not the number.


Quotesyntax: (unix:syslog num-priority str-message ...)

parameter: num-priority - The priority of the message.

parameter: str-message - The message string and template in printf format.
#7
I'd prefer to find it by only typing the problem or something about the function, and I think this would help a lot of users and newLisp as well. This is how it works with Linux problems and just anything else. But, all sites about newLisp are not indexed very well by the search sites. I wondered if no one recognized that.
#8
Ahh, that's it. Thanks!

But, the number needs to be a string as well.


(env "final_answer" "42")
#9
I tried using unix:syslog from here http://www.newlisp.org/code/modules/unix.lsp.html">http://www.newlisp.org/code/modules/unix.lsp.html



I don't know what printf format means, though I read the wikipedia entry.



All of these examples
(module "unix.lsp") (unix:syslog 5 "test %s")
(module "unix.lsp") (unix:syslog 5 "test%s")
(module "unix.lsp") (unix:syslog 5 "%s test")
(module "unix.lsp") (unix:syslog 5 "test" "%s")
(module "unix.lsp") (unix:syslog 5 "%s" "test")

give me a Segmentation fault, others as well.



I already added "/usr/lib/i386-linux-gnu/libc.so" ; Linux

to /usr/local/share/newlisp-10.6.2/modules/unix.ls
#10
I'm able to run programs in Linux by using (! <name>) or (exec <name>). But I can't declare variables.



MAIN:/home/usernamedeleted> (! "declare final_answer=42")

sh: 1: declare: not found

32512

MAIN:/home/usernamedeleted> (! "set final_answer=42")

0

MAIN:/home/usernamedeleted> (! "echo $final_answer")



0

MAIN:/home/usernamedeleted> (! "final_answer=42")

0

MAIN:/home/usernamedeleted> (! "echo $final_answer")



0

MAIN:/home/usernamedeleted> (! "export final_answer=42")

0

MAIN:/home/usernamedeleted> (! "echo $final_answer")



0

MAIN:/home/usernamedeleted>
#11
I would really love it, if I could find



- infos about newlisp functions

- newlisp snippets

- threads of this forum



in any search engine. Thanks.
#12
When I run a script of mine while putting (exit) at the end, it works. But if I want to stay inside of it after it run, I get this:
QuoteERR: string token too long : "|n|-----n| width="250" valign="top" |n* "


It's not about what this error regularly means, but why it appears only if I don't end the program. Anyway, this whole string handling is nasty.  I don't get things done this way.
#13
Thanks for your help so far, I might look into your code if I can use it.
#14
Even if this would be the right way to do it, then the print function also had to show it. You can't be serious about just keeping it how it is. It's invisible. A programmer can't know which files a user would be using as an input file, so this is one more thing to think of writing a program. Your line, or something like it, had to part of every script reading user generated or third party text files. Not to forget, non-advanced programmers won't have Unicode knowledge.



Is it really done this way in other languages, like Python?



I'd strongly prefer to have it not handled like this. I also see no need for it. To find out what file it is, should only be needed if it is really needed, and some function like "file" in Linux would be better to do that.  Maybe also some possibility to write a file with a BOM.



Yeah, but I see - Linux does it the same way:
> ((exec "cat ~/untitled")0)
"### Unicode?"
(((exec "cat ~/untitled")0)0)
""
Horrible, but it seems to be standard.
#15
I think programs are not supposed to read the BOM when reading a file (this way). When I do
$> cat file in Linux, then the BOM is not shown, nor in any other program. How I've shown above in newLisp it's even a difference when using println or using starts-with. This makes no sense at all, people may have the same problem than me over and over again.