Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Scheme Programming Language

how to return absolutely "nothing"?


hi

how to return absolutely "nothing"?
so that :
(list nothing 1 2 3 nothing 4 5 6) ; => (1 2 3 4 5 6)
This has bothered me for awhile and I had to ask.
This would help a lot.

Thanks.

dillog@gmail.com skrev:

> how to return absolutely "nothing"?
> so that :
> (list nothing 1 2 3 nothing 4 5 6) ; => (1 2 3 4 5 6)

You can't.

But (append (list 1 2 3) (list 4 5 6)) evaluates
to (1 2 3 4 5 6).

--
Jens Axel Sgaard

On Apr 29, 7:01 pm, "dillog@gmail.com" <dillog@gmail.com> wrote:

> hi

> how to return absolutely "nothing"?
> so that :
> (list nothing 1 2 3 nothing 4 5 6) ; => (1 2 3 4 5 6)
> This has bothered me for awhile and I had to ask.
> This would help a lot.

BTW, "void" or '() don't seem to be the same as absolutely nothing.

On Apr 29, 7:06 pm, Jens Axel Sgaard <use@soegaard.net> wrote:

> dillog@gmail.com skrev:

> > how to return absolutely "nothing"?
> > so that :
> > (list nothing 1 2 3 nothing 4 5 6) ; => (1 2 3 4 5 6)

> You can't.

> But (append (list 1 2 3) (list 4 5 6)) evaluates
> to (1 2 3 4 5 6).

Is there a good reason for not supporting this in the language?
There are a lot of good use for it.

On Apr 29, 7:06 pm, Jens Axel Sgaard <use@soegaard.net> wrote:

> dillog@gmail.com skrev:

> > how to return absolutely "nothing"?
> > so that :
> > (list nothing 1 2 3 nothing 4 5 6) ; => (1 2 3 4 5 6)

> You can't.

Christian Jaeger from gambit group just show me how to do it, so I
guess you don't always tell the truth.
`(1 2 3 ,@(if (> 1 2) (list 3) '()) 4 5 6)

Is your job to mislead people on this group?

On Apr 29, 7:06 pm, Jens Axel Sgaard <use@soegaard.net> wrote:

> dillog@gmail.com skrev:

> > how to return absolutely "nothing"?
> > so that :
> > (list nothing 1 2 3 nothing 4 5 6) ; => (1 2 3 4 5 6)

> You can't.

You can always say nothing if you don't want to help. But stop lying
to people.

dillog@gmail.com skrev:

> On Apr 29, 7:06 pm, Jens Axel Sgaard <use@soegaard.net> wrote:
>> dillog@gmail.com skrev:

>>> how to return absolutely "nothing"?
>>> so that :
>>> (list nothing 1 2 3 nothing 4 5 6) ; => (1 2 3 4 5 6)
>> You can't.

> Christian Jaeger from gambit group just show me how to do it, so I
> guess you don't always tell the truth.
> `(1 2 3 ,@(if (> 1 2) (list 3) '()) 4 5 6)

He answers a different question.

> Is your job to mislead people on this group?

Is your job to insult people?

--
Jens Axel Sgaard

On Sun, 29 Apr 2007 04:01:44 -0700, dillog@gmail.com wrote:
> hi

> how to return absolutely "nothing"?
> so that :
> (list nothing 1 2 3 nothing 4 5 6) ; => (1 2 3 4 5 6) This has bothered
> me for awhile and I had to ask. This would help a lot.

Wouldn't you just run filter over the list with a predicate that returned
false for each of the nothings?

Cheers,

--
Andrew

On Apr 29, 9:27 pm, Andrew Reilly <andrew-newsp@areilly.bpc-

users.org> wrote:
> On Sun, 29 Apr 2007 04:01:44 -0700, dillog@gmail.com wrote:
> > hi

> > how to return absolutely "nothing"?
> > so that :
> > (list nothing 1 2 3 nothing 4 5 6) ; => (1 2 3 4 5 6) This has bothered
> > me for awhile and I had to ask. This would help a lot.

> Wouldn't you just run filter over the list with a predicate that returned
> false for each of the nothings?

There are ways around, but why not support this in the language?

Jens Axel Sgaard skrev:

> dillog@gmail.com skrev:
>> Is your job to mislead people on this group?

> Is your job to insult people?

That came out a little harsh.

A bit of advice: When people try to help you in
an area, where you are new - listen. If you
are unhappy with the result, there could be
several causes. It is very rare people are
being misleading - not getting a perfect
answer on usenet is common. However, there
is always the possibility that there is
something you have missed - especially,
when learning about new things.

Making snide remarks has only one effect:
You won't get any answers the next time
you have a problem.

--
Jens Axel Sgaard

On Apr 29, 9:34 pm, Jens Axel Sgaard <use@soegaard.net> wrote:

Sorry, I weren't quite correct, either. The current language indeed
can't return "nothing".
What he shows me was only a way around.
I guess I was more pissed about the language giving me trouble.
Sorry, on my part too.

On Apr 29, 9:38 pm, "dillog@gmail.com" <dillog@gmail.com> wrote:

There are times when you can't simply push all the logic to the
caller,
either because the caller hasn't been written yet, or it would become
ugly if I push all the logic to the caller.
I don't know how much trouble this would cause implementators to
support this.
Anyway, I'm just ranting.

On Apr 29, 2:08 pm, "dillog@gmail.com" <dillog@gmail.com> wrote:

> On Apr 29, 7:06 pm, Jens Axel Sgaard <use@soegaard.net> wrote:

> > dillog@gmail.com skrev:

> > > how to return absolutely "nothing"?
> > > so that :
> > > (list nothing 1 2 3 nothing 4 5 6) ; => (1 2 3 4 5 6)

> > You can't.

> You can always say nothing if you don't want to help. But stop lying
> to people.

Wow.... thats not nice. Jens is a really helpful guy.
On Apr 29, 10:20 pm, wooks <woo@hotmail.com> wrote:

So, I will be the bad guy. What do I care? I can't live for more then
a hundred years on earth.
The purpose of the group is to improve the language-- at least that's
my naive thinking.

Currently, <#void> and nil does nothing useful. Maybe <#void> should
be interpreted as "absolutely nothing".
Unless you have good technical reason for not doing so.
What do I care? I don't have stake in this anyway.
I can always switch to something easier to write my code with.
The language is to make people's job easier and not to impede or
enforce unreasonable convention.

On Apr 29, 3:58 pm, "dillog@gmail.com" <dillog@gmail.com> wrote:

Are you being made to use Scheme against your will?
On Apr 29, 10:20 pm, wooks <woo@hotmail.com> wrote:

Are you a politics? What the hell is this group for? pretending who's
nicer? Do I get to vote?
On Apr 29, 11:05 pm, wooks <woo@hotmail.com> wrote:

Do you use scheme to torture yourself?
On Apr 29, 4:08 pm, "dillog@gmail.com" <dillog@gmail.com> wrote:

It was a sincere question, but I'll take that as a yes.
Hi,

Seem a tad frustrated.  People on the newsgroup genuinely do try to help -
may not always be correct - and as always, others may differ on opinions.
If you spray on people who are trying to help you then you risk no one
bothering to help you - ever.  And you come across as a tool.  Perhaps your
comments weren't wise, don't you think?

I almost asked you to re-phrase the question because it didn't seem
possible.  Based on what wrote, you wanted a procedure that returned
nothing - and I don't know how that is possible in scheme, but I'm just
learning the language so what would I know?

Procedures resolve to predicates, numbers, strings, pairs, symbols, lists
etc.  Perhaps there is something in Scheme that equates to a threaded
countdown - like a timer in Delphi.

Your code was (list nothing 1 2 3 nothing 4 5 6);==> (1 2 3 4 5 6)

`(1 2 3 ,@(if (> 1 2) (list 3) '()) 4 5 6)) might resolve to what you want
but it is not what you asked (so far as I can tell).  The same result can be
obtained by (list 1 2 3 4 5 6) or (append (list 1 2 3) (list 4 5 6)) but
these don't match what you describe in the code.

I don't know enough about the solution you gave below to know how to fit
that into the code you gave, to get the result you wanted.  But if that code
is the procedure nothing, then

(define nothing `(1 2 3 ,@(if (> 1 2) (list 3) '()) 4 5 6))
(list 1 2 3 nothing 4 5 6)
;==> (1 2 3 (1 2 3 4 5 6) 4 5 6)

Can you please show the code for nothing so that (list nothing 1 2 3 nothing
4 5 6);==> (1 2 3 4 5 6)?

Mike

<dillog@gmail.com> wrote in message

news:1177852004.584663.39100@c35g2000hsg.googlegroups.com...
On Apr 29, 7:06 pm, Jens Axel Sgaard <use@soegaard.net> wrote:

> dillog@gmail.com skrev:

> > how to return absolutely "nothing"?
> > so that :
> > (list nothing 1 2 3 nothing 4 5 6) ; => (1 2 3 4 5 6)

> You can't.

Christian Jaeger from gambit group just show me how to do it, so I
guess you don't always tell the truth.
`(1 2 3 ,@(if (> 1 2) (list 3) '()) 4 5 6)

Is your job to mislead people on this group?

On Apr 29, 11:21 pm, wooks <woo@hotmail.com> wrote:

There is no way I can tell whether you are sincere or not.
Do you have something pertinent to say relating to the issue?

<dillog@gmail.com> wrote in message

news:1177859244.939978.205740@o5g2000hsb.googlegroups.com...
[...]

>Are you a politics? What the hell is this group for? pretending who's
>nicer? Do I get to vote?

Ummm ... dude, stay calm.  You are not doing yourself any favours by this
sort of post.
Hey ... not fair to poke the wounded :)

"wooks" <woo@hotmail.com> wrote in message

news:1177860064.008756.81950@n59g2000hsh.googlegroups.com...
On Apr 29, 4:08 pm, "dillog@gmail.com" <dillog@gmail.com> wrote:

It was a sincere question, but I'll take that as a yes.

dillog@gmail.com wrote:
> On Apr 29, 9:27 pm, Andrew Reilly <andrew-newsp@areilly.bpc-
>> Wouldn't you just run filter over the list with a predicate that returned
>> false for each of the nothings?

> There are ways around, but why not support this in the language?

What problem do you need to solve that you need this language feature
for?  Maybe there is a Scheme idiom that will solve it as elegantly but
in a different way?

Tom

On Apr 29, 4:29 pm, "dillog@gmail.com" <dillog@gmail.com> wrote:

Yeah.... disabuse yourself of the notion that everybody who responds
to you is telling lies.
Just a thought,

And have seen your solution BTW.

This looks like a halting program - can't be resolved.  Not that this helps
...

Mike

<dillog@gmail.com> wrote in message

news:1177844504.247996.218630@q75g2000hsh.googlegroups.com...

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc