Gmail Календар Документи Фотознімки Веб Ще »
Групи, які ви переглядали нещодавно | Довідка | Увійти
Головна сторінка Груп Google
Допис з розмови How to set the value?
Група, до якої ви додаєте допис, - група Usenet. Відтак, будь-хто в Інтернеті бачитиме вашу електронну адресу.
Вашу відповідь не було надіслано.
Ваш допис надіслано
 
Від:
Кому:
Копія:
Продолжить:
Додати копію: | Додати продовження: | Редагувати тему
Тема:
Підтвердження:
З метою підтвердження введіть символи, наведені на зображенні нижче, або числа, які чуєте, натиснувши значок доступу. Прослухайте і введіть цифри, що чуєте
 
Anti Vigilante  
Переглянути профіль   Перекласти вказаною мовою: Перекладено (переглянути оригінал)
 Більше налаштувань 7 Лис 2009, 06:33
Групи новин: comp.lang.lisp
Від: Anti Vigilante <antivigila...@pyrabang.com>
Дата: Fri, 06 Nov 2009 21:33:05 -0700
Місцевий час: Сб 7 Лис 2009 06:33
Тема: Re: How to set the value?

On Sat, 2009-11-07 at 05:15 +0100, Pascal J. Bourguignon wrote:
> 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?

wouldn't setf also cause interesting effects?

    Переслати  
Ви мусите увійти перед публікацією повідомлень.
Аби надіслати допис, будь ласка, спочатку приєднайтеся до цієї групи.
Будь ласка, поновіть своє прізвисько на сторінці налаштування передплати перед тим, як надіслати свій допис.
У вас немає права надсилання дописів до цієї групи.

Створити групу - Групи Google - Домашня сторінка Google - Правила користування послугою - Заява про конфіденційність і нерозголошення інформації
©2010 Google