Home > Archive > Scheme > May 2004 > NNTP open-news-group expects type <string or input-port> as 2nd argument
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
NNTP open-news-group expects type <string or input-port> as 2nd argument
|
|
| Mark Carter 2004-05-12, 9:12 pm |
|
Trying my best at learning Scheme ...
I'm using
DrScheme, version 206p1.
Language: Pretty Big (includes MrEd and Advanced).
When I type the following program:
(require (lib "nntp.ss" "net"))
(define c (connect-to-server "dali"))
(define r (open-news-group c "internal.misc"))
I get the response:
regexp-match: expects type <string or input-port> as 2nd argument,
given: #<eof>; other arguments were: #rx"([0-9]+) (.*)"
The problem is in open-news-group
I'm fairly sure that there's nothing wrong with the way I've set up a
server, because when I type in the roughly equivalent python program:[color=darkred]
3
I get no problems at all.
Any ideas what the problem is?
| |
| Bruce Butterfield 2004-05-12, 9:12 pm |
| Mark Carter <cartermark46@ukmail.com> wrote in message news:<2g45ilF4bqobU1@uni-berlin.de>...
I am not having any problems connecting to (for instance) the news
group "comp.lang.scheme" on the news server "humboldt.nl.linux.org"
using that exact code. I suspect you aren't actually getting a
connection to "dali" (try using a fully qualified server name,
perhaps?).
> Trying my best at learning Scheme ...
>
> I'm using
> DrScheme, version 206p1.
> Language: Pretty Big (includes MrEd and Advanced).
>
> When I type the following program:
> (require (lib "nntp.ss" "net"))
> (define c (connect-to-server "dali"))
> (define r (open-news-group c "internal.misc"))
>
> I get the response:
> regexp-match: expects type <string or input-port> as 2nd argument,
> given: #<eof>; other arguments were: #rx"([0-9]+) (.*)"
> The problem is in open-news-group
| |
| MJ Ray 2004-05-12, 9:12 pm |
| Mark Carter <cartermark46@ukmail.com> wrote:
> though - which is my own machine. Didn't like "localhost" or "127.0.0.1"
> either. Like I say, I think I've got my nntp server set up correctly
> because python connects to it fine.
You could try asking on plt-scheme whether anyone can reproduce this problem,
as I can't. Then again, I'm not using your "evil" platform.
> Oh well, I think I'd better stick to python. Thanks for the help anyway.
You are a troll AICM5P.
| |
| Eli Barzilay 2004-05-12, 9:12 pm |
| Mark Carter <cartermark46@ukmail.com> writes:
> When I type the following program:
> (require (lib "nntp.ss" "net"))
> (define c (connect-to-server "dali"))
> (define r (open-news-group c "internal.misc"))
>
> I get the response:
> regexp-match: expects type <string or input-port> as 2nd argument, given:
> #<eof>; other arguments were: #rx"([0-9]+) (.*)"
This is a bug in the code, where it assumes that it gets a string and
your server slams the door instead. I fixed it in cvs, but using the
fix just means that you'll get a better error message.
> The problem is in open-news-group
>
> I'm fairly sure that there's nothing wrong with the way I've set up a server,
> because when I type in the roughly equivalent python program:
>
> 3
>
> I get no problems at all.
>
> Any ideas what the problem is?
Ignoring the semi-flame, the problem seems to be with the way your
server interacts with the plt code, shutting the connection instead of
an expected status line. It might be helpful to trace the tcp port
and see if there is anything wrong. If you do this and find that your
server is responding fine but the plt code is somehow not doing things
correctly, then please file a bug report. (It's a much more effective
way for getting bugs fixed than posting... I'm sure that this is true
even for python.)
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!
| |
| Eli Barzilay 2004-05-12, 9:12 pm |
| Mark Carter <cartermark46@ukmail.com> writes:
>
>
> Thanks ... but I have already written a fair amount of code that
> does what I want in python.
As Jens said, it would be helpful to see how that server interacts
with the library regardless of any language.
> I had wanted to experiment with Scheme to see how easy/difficult it
> would be to get something going (I think you can guess my
> conclusion). [...]
From this and other messages you sent, It sounds like you were
considering playing with Scheme instead of playing with Python. From
the above, it looks like your conclusion is that you should stick with
Python. Given that your stated goal was to experiment with Scheme,
either your conclusion is unjustified, or you retroactively classify
yourself as a troll.
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!
| |
| Eli Barzilay 2004-05-12, 9:12 pm |
| Mark Carter <cartermark46@ukmail.com> writes:
>
> Also worth a mention is the fact that Thunderbird seems to connect
> to Hamster perfectly fine, too.
>
> Unfortunately, it would not be possible for outsiders to connect to
> my server. The server that I have running at work is behind a
> firewall; and the one I have at home just uses a dialup account,
And the plt-scheme nntp thing fails with both?
> so it wouldn't be practical for people to access it.
Should be practical for debugging the problem.
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!
| |
| Eli Barzilay 2004-05-12, 9:12 pm |
| Mark Carter <cartermark46@ukmail.com> writes:
>
> Blimey.
>
> I've decided that my priorities will be to get the stuff that I want
> working done in Python first. Later (maybe), I'll investigate what's
> going on in Scheme with a view to seeing who right, who's wrong, and
> what can be done about it.
(Your loss.)
> I do have a real job, this is just a hobby.
>
> Can we all agree to shake hands like gentlemen on this?
Sure.
(I realize it wasn't intended, but I hate seeing the whole language
being disqualified on account of a single bug. No flames intended.)
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!
| |
| Eli Barzilay 2004-05-12, 9:12 pm |
| Mark Carter <cartermark46@ukmail.com> writes:
> Eli Barzilay wrote:
>
>
> If you mean the office as well as home, then the answer is ... I
> haven't tried.
Yes.
> If you mean Hamster as well as Thunderbird, then the answer is
> ... Thunderbird is a newsreader, so plt-scheme wouldn't work with
> it, nor would one expect it to.
I know that thunderbird is not a server.
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!
| |
| MJ Ray 2004-05-12, 9:12 pm |
| Mark Carter <cartermark46@ukmail.com> wrote:
> MJ Ray wrote:
> I protest, sir!
I don't care whether you meant to troll, or whether you were trolling as
sport or not, but it was still a troll.
> I admit I'm a newbie to Scheme - and I think learning it is quite an
> uphill struggle. Python is much easier to get into, seriously. [...]
Possibly, but there are some real nasties in there when you are properly
in it. I have no idea what edwin is like, as I've been scheming for years
without having used it.
> I suspect that things are a lot better for Unix users than they are for
> Windows, though.
Isn't everything?
> Maybe Scheme needs more "hobbyists" than academics.
Of course, all the people who meet at scheme-uk's meeting are such academics
because scheme has no other users. Hrm, where's the schememonster when we
need it?
> Now, where did I put that asbestos suit.
When you get in, please breathe deeply. ;-)
| |
| Lauri Alanko 2004-05-12, 9:12 pm |
| In article <409f953f$0$20517$cc9e4d1f@news-text.dial.pipex.com>,
MJ Ray <mjr@dsl.pipex.com> wrote:
> I don't care whether you meant to troll, or whether you were trolling as
> sport or not, but it was still a troll.
Uh, trolling is by definition intentional. And the definition is not
"saying something stupid or provocative". A real troll, when well
executed, is a delight.
http://www.catb.org/~esr/jargon/html/T/troll.html
Lauri Alanko
la@iki.fi
| |
| MJ Ray 2004-05-12, 9:12 pm |
| Lauri Alanko <la@iki.fi> wrote:
> Uh, trolling is by definition intentional. And the definition is not
> "saying something stupid or provocative". A real troll, when well
> executed, is a delight.
> http://www.catb.org/~esr/jargon/html/T/troll.html
Before quoting a definition against me, please try reading that definition
yourself, first:
"To utter a posting on Usenet designed to attract predictable responses
or flames;"
and notice that it does not say it need be intentionally designed to do
that. You can notice your error if you read to the end. Later in the
same definition, it mentions "a deliberate troll". Why would it do that
if *all* trolls must be intentional to be trolls? Maybe for emphasis,
but I don't think that's the case here.
Of course, you could email ESR a list of questions and ask, if you want.
Finally, that's a US jargon dictionary. It misses common Englishisms like
AICM5P, which would suggest the humour in my reply to the (UK-based)
OP. If you don't understand something, please ask what I meant before
trying to correct me with a foreign language.
Wildly OT. FUs to poster, please.
| |
| Eli Barzilay 2004-05-12, 9:13 pm |
| FYI, the bug is fixed, and logging in is available.
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!
|
|
|
|
|