Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
How to set the value?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  18 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
vj  
View profile   Translate to Translated (View Original)
 More options 7 Nov, 03:26
Newsgroups: comp.lang.lisp
From: vj <harik...@gmail.com>
Date: Fri, 6 Nov 2009 19:26:19 -0800 (PST)
Local: Sat 7 Nov 2009 03:26
Subject: How to set the value?
Hi All,

I have been programming in LISP for couple of months now.
Today, came across a new notation and had a question on that.
Let me give an example:

I have an access to an "object" [i don't know what the technical term
is for a variable of this data-type].

(setq some_var data.some_val)

by doing the above, i can read the value into some_var.

but the following piece of code is not working and i am not sure if i
am even on the right track.

(setq read_var data.some_val) # read the value
(print read_var) # say the value was originally set to 5, we would see
5 here
(setq some_var 18) # sets the value to 18
(setq data.some_val some_var) # i expect data.some_val to be set to 18
now
(setq read_var data.some_val) # read the value just set
(print read_var) # i would expect 18 to be displayed. but i still see
5.

why would this be?

TIA


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pascal J. Bourguignon  
View profile   Translate to Translated (View Original)
 More options 7 Nov, 04:15
Newsgroups: comp.lang.lisp
From: p...@informatimago.com (Pascal J. Bourguignon)
Date: Sat, 07 Nov 2009 05:15:09 +0100
Local: Sat 7 Nov 2009 04:15
Subject: Re: How to set the value?

vj <harik...@gmail.com> writes:
> I have been programming in LISP for couple of months now.

To really answer to your following question, we would have to know
what decendent of LISP do you really use?

Is that Common Lisp, ISOLisp, LeLisp, Scheme, MacLisp, emacs lisp,
ZetaLisp, InterLisp, etc, etc, etc?

> Today, came across a new notation and had a question on that.
> Let me give an example:

> I have an access to an "object" [i don't know what the technical term
> is for a variable of this data-type].

> (setq some_var data.some_val)

> by doing the above, i can read the value into some_var.

Assuming it's Common Lisp, and no special reader trick is active,
data.some_val is a mere symbol and therefore it is either a normal
variable as well as some_var, or it is a symbol macro, and probably
represents some place that is both readable and writeable like a
normal variable.

In either case, you can get its value by evaluating directly
data.some_val, you don't need to store it in some_var.

Actually, since you've not shown us that you defined the variable
some_var, some strange things may occur in a Common Lisp
implementation when you evaluate this setq out of white at the
toplevel...

> but the following piece of code is not working and i am not sure if i
> am even on the right track.

> (setq read_var data.some_val) # read the value
> (print read_var) # say the value was originally set to 5, we would see
> 5 here
> (setq some_var 18) # sets the value to 18
> (setq data.some_val some_var) # i expect data.some_val to be set to 18
> now
> (setq read_var data.some_val) # read the value just set
> (print read_var) # i would expect 18 to be displayed. but i still see
> 5.

> why would this be?

It could occur that data.some_val is a symbol macro that expands to an
accessor, and that the writer method for this accessor doesn't write
the value for some reason (perhaps the new value is invalid for this
object?).

In any case you are not giving us the context, we don't even know what
language you're speaking of!  So how can we give you a meaningful answer?

--
__Pascal Bourguignon__


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anti Vigilante  
View profile   Translate to Translated (View Original)
 More options 7 Nov, 04:33
Newsgroups: comp.lang.lisp
From: Anti Vigilante <antivigila...@pyrabang.com>
Date: Fri, 06 Nov 2009 21:33:05 -0700
Local: Sat 7 Nov 2009 04:33
Subject: Re: How to set the value?

wouldn't setf also cause interesting effects?

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pascal J. Bourguignon  
View profile   Translate to Translated (View Original)
 More options 7 Nov, 04:42
Newsgroups: comp.lang.lisp
From: p...@informatimago.com (Pascal J. Bourguignon)
Date: Sat, 07 Nov 2009 05:42:41 +0100
Local: Sat 7 Nov 2009 04:42
Subject: Re: How to set the value?

Anti Vigilante <antivigila...@pyrabang.com> writes:
> wouldn't setf also cause interesting effects?

SETF would be more explicit.

SETQ must actually work like SETF when given a symbol macro as target.

--
__Pascal Bourguignon__


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas A. Russ  
View profile   Translate to Translated (View Original)
 More options 7 Nov, 04:14
Newsgroups: comp.lang.lisp
From: t...@sevak.isi.edu (Thomas A. Russ)
Date: 06 Nov 2009 20:14:17 -0800
Local: Sat 7 Nov 2009 04:14
Subject: Re: How to set the value?

vj <harik...@gmail.com> writes:
> Hi All,

> I have been programming in LISP for couple of months now.
> Today, came across a new notation and had a question on that.

Um, what "new notation" did you come across?
Having a "." as part of a symbol name doesn't mean anything special in
lisp.  It is similar to having an "_", a "-", or any other character in
the name.

Are you expecting something different?

> Let me give an example:

> I have an access to an "object" [i don't know what the technical term
> is for a variable of this data-type].

> (setq some_var data.some_val)

> by doing the above, i can read the value into some_var.

> but the following piece of code is not working and i am not sure if i
> am even on the right track.

> (setq read_var data.some_val) # read the value

OK.  What happens here is that the value of read_var [more lisp-like
would be read-var] is set to the value of data.some_val.  This only sets
teh value of read_var.  It doesn't establish any other link between
those variables.

I also wonder about your use of the unusual (for lisp) dot notation in
the names of your variables.  This doesn't really create objects with
slots.  It just creates ordinary variables that happen to have a "." in
their name.

> (print read_var) # say the value was originally set to 5, we would see
> 5 here

Even simpler is to just type "read_var" at the interactive prompt.  It
will then print the value for you.

> (setq some_var 18) # sets the value to 18
> (setq data.some_val some_var) # i expect data.some_val to be set to 18
> now

OK.  This should set the value as you expect.

> (setq read_var data.some_val) # read the value just set

OK.

> (print read_var) # i would expect 18 to be displayed. but i still see
> 5.

Well, this seems a bit odd.  What lisp system are you using when doing
this?  # isn't a line comment character in any lisp system that I'm
aware of.  Can you paste the actual transcript of your session?

When I try your example, I get the expected results:

CL-USER> (setq data.some_val 5)
5
CL-USER> (setq read_var data.some_val)
5
CL-USER> (print read_var)

5
5
CL-USER> (setq some_var 18)
18
CL-USER> (setq data.some_val some_var)
18
CL-USER> (setq read_var data.some_val)
18
CL-USER> (print read_var)

18
18

--
Thomas A. Russ,  USC/Information Sciences Institute


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Warnock  
View profile   Translate to Translated (View Original)
 More options 7 Nov, 08:47
Newsgroups: comp.lang.lisp
From: r...@rpw3.org (Rob Warnock)
Date: Sat, 07 Nov 2009 02:47:41 -0600
Local: Sat 7 Nov 2009 08:47
Subject: Re: How to set the value?
Pascal J. Bourguignon <p...@informatimago.com> wrote:
+---------------
| Actually, since you've not shown us that you defined the variable
| some_var, some strange things may occur in a Common Lisp implementation
| when you evaluate this setq out of white at the toplevel...
+---------------

Aha! Interesting difference in idioms here: in the U.S. one would say
"out of the blue" instead of "white".

-Rob

-----
Rob Warnock                     <r...@rpw3.org>
627 26th Avenue                 <URL:http://rpw3.org/>
San Mateo, CA 94403             (650)572-2607


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pascal J. Bourguignon  
View profile   Translate to Translated (View Original)
 More options 7 Nov, 12:45
Newsgroups: comp.lang.lisp
From: p...@informatimago.com (Pascal J. Bourguignon)
Date: Sat, 07 Nov 2009 13:45:10 +0100
Local: Sat 7 Nov 2009 12:45
Subject: Re: How to set the value?

r...@rpw3.org (Rob Warnock) writes:
> Pascal J. Bourguignon <p...@informatimago.com> wrote:
> +---------------
> | Actually, since you've not shown us that you defined the variable
> | some_var, some strange things may occur in a Common Lisp implementation
> | when you evaluate this setq out of white at the toplevel...
> +---------------

> Aha! Interesting difference in idioms here: in the U.S. one would say
> "out of the blue" instead of "white".

Well, not being a native speaker, I must have misremembered the idiom.
So: s/white/the blue/

--
__Pascal Bourguignon__


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
webmasterATflymagnetic.co m  
View profile   Translate to Translated (View Original)
 More options 7 Nov, 14:56
Newsgroups: comp.lang.lisp
From: "webmasterATflymagnetic.com" <webmas...@flymagnetic.com>
Date: Sat, 7 Nov 2009 06:56:01 -0800 (PST)
Local: Sat 7 Nov 2009 14:56
Subject: Re: How to set the value?
On Nov 7, 12:45 pm, p...@informatimago.com (Pascal J. Bourguignon)
wrote:

Naw -- Europe's cloudier than the US; white skies rather than blue
skies.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Michalik  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 02:33
Newsgroups: comp.lang.lisp
From: Adam Michalik <dode...@gmail.com>
Date: Sun, 08 Nov 2009 03:33:50 +0100
Local: Sun 8 Nov 2009 02:33
Subject: Re: How to set the value?

"webmasterATflymagnetic.com" <webmas...@flymagnetic.com> writes:
> Naw -- Europe's cloudier than the US; white skies rather than blue
> skies.

Surely even grass is greener in the US, am I right?

--
Adam Michalik
 vel Dodek Dodecki
<dodek[]dodecki.net>


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
vj  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 03:44
Newsgroups: comp.lang.lisp
From: vj <harik...@gmail.com>
Date: Sat, 7 Nov 2009 19:44:55 -0800 (PST)
Local: Sun 8 Nov 2009 03:44
Subject: Re: How to set the value?
Thanks Pascal and Thomas.

Your comments were useful and made me dig further. Turns out that lisp
was running on top of a plugin. So, data.some_val would actually
execute a method [data here] in the plugin and return the value for
the variable of name some_val.

As Pascal rightly expected, the some_val was only "readable" and not
"writeable" (for lack of a corresponding method in the plugin
implementation).

hagw.

On Nov 7, 8:33 pm, Adam Michalik <dode...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Warnock  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 08:50
Newsgroups: comp.lang.lisp
From: r...@rpw3.org (Rob Warnock)
Date: Sun, 08 Nov 2009 02:50:57 -0600
Local: Sun 8 Nov 2009 08:50
Subject: Re: How to set the value?
webmasterATflymagnetic.com <webmas...@flymagnetic.com> wrote:

+---------------
| p...@informatimago.com (Pascal J. Bourguignon) wrote:
| > r...@rpw3.org (Rob Warnock) writes:
| > > Pascal J. Bourguignon <p...@informatimago.com> wrote:
| > > +---------------
| > > | ...strange things may occur in a Common Lisp implementation
| > > | when you evaluate this setq out of white at the toplevel...
| > > +---------------
| >
| > > Aha! Interesting difference in idioms here: in the U.S. one would say
| > > "out of the blue" instead of "white".
| >
| > Well, not being a native speaker, I must have misremembered the idiom.
| > So: s/white/the blue/
|
| Naw -- Europe's cloudier than the US; white skies rather than blue skies.
+---------------

Actually, looking at Wiktionary[1] it would seem that in most European
countries the analogous idiom to the English "out of the blue" has
more to do with "clear sky" rather than "the blue" [albeit clear skies
*are* typically blue], and *not* "white" [though see (Russia#2) below]:

    - From clear sky (Germany)

    - Like a lightning bolt out of a clear sky (Finland, Sweden)

    - Like a thunder {from,in} {the,a} clear sky (Bosnia, Serbia,
      Croatia, Lithuania, Russia#1, Iceland#1)

Some more... indirect phrases were also given as alternates:

    - Like snow onto the head (Russia#2)

    - Like the devil from the sheep's leg (Iceland#2)

Alternatives in English include "out of nowhere" and "[a] bolt from
the blue", the latter being *quite* similar to the Finnish/Swedish,
since "bolt" here means a lightening bolt.

But I'm sorry, Pascal. I couldn't find one that was uniquely French...

-Rob

[1] http://en.wiktionary.org/wiki/out_of_the_blue

-----
Rob Warnock                     <r...@rpw3.org>
627 26th Avenue                 <URL:http://rpw3.org/>
San Mateo, CA 94403             (650)572-2607


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pascal J. Bourguignon  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 10:46
Newsgroups: comp.lang.lisp
From: p...@informatimago.com (Pascal J. Bourguignon)
Date: Sun, 08 Nov 2009 11:46:52 +0100
Local: Sun 8 Nov 2009 10:46
Subject: Re: How to set the value?

I guess the corresponding expression would be "un éclair en plein jour",  
which is quite rareley used.  (Google finds 13 occurences, of which
only 3 have the English idiom meaning, the others being literal
meaning).

--
__Pascal Bourguignon__


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vassil Nikolov  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 16:18
Newsgroups: comp.lang.lisp
From: Vassil Nikolov <vniko...@pobox.com>
Date: Sun, 08 Nov 2009 11:18:06 -0500
Local: Sun 8 Nov 2009 16:18
Subject: Re: How to set the value?

On Sun, 08 Nov 2009 02:50:57 -0600, r...@rpw3.org (Rob Warnock) said:

> ...
>     - Like a thunder {from,in} {the,a} clear sky (Bosnia, Serbia,
>       Croatia, Lithuania, Russia#1, Iceland#1)

  Add Bulgaria to this list.

  As a sidenote, there is (at least in Bulgarian) an expression that
  literally means "see stars in the middle of a white day", which
  refers to the "stars" one "sees" after a strike on the head, but
  that is a rather special case of surprise.

  ---Vassil.

--
"Even when the muse is posting on Usenet, Alexander Sergeevich?"


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
George Neuner  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 19:39
Newsgroups: comp.lang.lisp
From: George Neuner <gneun...@comcast.net>
Date: Sun, 08 Nov 2009 14:39:27 -0500
Local: Sun 8 Nov 2009 19:39
Subject: Re: How to set the value?
On Sun, 08 Nov 2009 03:33:50 +0100, Adam Michalik <dode...@gmail.com>
wrote:

>"webmasterATflymagnetic.com" <webmas...@flymagnetic.com> writes:

>> Naw -- Europe's cloudier than the US; white skies rather than blue
>> skies.

>Surely even grass is greener in the US, am I right?

You mean browner - the US being the source of global warming and
whatnot.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Warnock  
View profile   Translate to Translated (View Original)
 More options 10 Nov, 04:56
Newsgroups: comp.lang.lisp
From: r...@rpw3.org (Rob Warnock)
Date: Mon, 09 Nov 2009 22:56:40 -0600
Local: Tues 10 Nov 2009 04:56
Subject: Re: How to set the value?
Pascal J. Bourguignon <p...@informatimago.com> wrote:
+---------------
| r...@rpw3.org (Rob Warnock) writes:
| > But I'm sorry, Pascal. I couldn't find one that was uniquely French...
|
| I guess the corresponding expression would be "un éclair en plein jour",  
| which is quite rareley used.
+---------------

My sister (who speaks *much* better French than I!) says that the
Harper/Collins/Robert dictionary lists "coup de tonnerre" -- literally
"a clap of thunder" or "thunderclap", but figuratively meaning
"bombshell", "bolt from the blue", or "thunderbolt". Does that
sound appropriate here?

[A friend of hers also suggested "sans crier gare" -- "without any
warning or unexpectedly" -- but I'm not sure that's quite the same.]

-Rob

-----
Rob Warnock                     <r...@rpw3.org>
627 26th Avenue                 <URL:http://rpw3.org/>
San Mateo, CA 94403             (650)572-2607


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pascal J. Bourguignon  
View profile   Translate to Translated (View Original)
 More options 10 Nov, 08:17
Newsgroups: comp.lang.lisp
From: p...@informatimago.com (Pascal J. Bourguignon)
Date: Tue, 10 Nov 2009 09:17:48 +0100
Local: Tues 10 Nov 2009 08:17
Subject: Re: How to set the value?

Yes, "sans crier gare" would mean the same.

On the other hand, I'm not sure about "coup de tonnerre", since it's
usually preceded by the flash...

--
__Pascal Bourguignon__
http://www.informatimago.com


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alberto Riva  
View profile   Translate to Translated (View Original)
 More options 11 Nov, 04:28
Newsgroups: comp.lang.lisp
From: Alberto Riva <ar...@nospam.ufl.edu>
Date: Tue, 10 Nov 2009 23:28:17 -0500
Local: Wed 11 Nov 2009 04:28
Subject: Re: How to set the value?

In Italian we have "fulmine a ciel sereno", which is essentially the
same as the Finnish and Swedish expression above. It's normally used for
things that are totally surprising and unexpected, so it has a
"stronger" meaning than the English idiom...

Alberto


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
GP lisper  
View profile   Translate to Translated (View Original)
 More options 15 Nov, 10:26
Newsgroups: comp.lang.lisp
From: GP lisper <spamb...@CloudDancer.com>
Date: Sun, 15 Nov 2009 02:26:27 -0800
Local: Sun 15 Nov 2009 10:26
Subject: Re: How to set the value?

On Sun, 08 Nov 2009 11:18:06 -0500, <vniko...@pobox.com> wrote:

> On Sun, 08 Nov 2009 02:50:57 -0600, r...@rpw3.org (Rob Warnock) said:
>> ...
>>     - Like a thunder {from,in} {the,a} clear sky (Bosnia, Serbia,
>>       Croatia, Lithuania, Russia#1, Iceland#1)

>   Add Bulgaria to this list.

>   As a sidenote, there is (at least in Bulgarian) an expression that
>   literally means "see stars in the middle of a white day", which
>   refers to the "stars" one "sees" after a strike on the head, but
>   that is a rather special case of surprise.

Ah, the things I learn in c.l.l that bring a smile to my face.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google