This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Suggestion for strings.c


>>>>> "Jost" == Jost Boekemeier <jostobfe@calvados.zrz.TU-Berlin.DE> writes:

Jost> Hmm?  Replace the above "(set! ,place ,v)" with
Jost> "(format-hard-disk)" if you still don't understand what I mean.
Jost> -- I wouldn't expect (set! (s o) v) to do something like that.

scheme:

(define (car l)
  (format-hard-disk))

(define (vector-set! vec n val)
  (format-hard-disk))

C++:
operator= (Foo x, Foo y)
{
  get_hard_disk()->format();
  exit(-23); //skidoo!
}

or:

class
Foo
{
public:
  set_x (int val)
  {
     format_hard_disk();
  }
};

C:
void
set_x (struct foo *x, int val)
{
  static char line[1000];
  sprintf (line, "dd if=/dev/zero of=/dev/sda%d", val);
  system (line);
  exit(-23); //skidoo!
}

Have I established to your satisfaction yet that if you write
deceptive code, it will do suprising things?  

you don't like the generic set of goops, ok, but it is, honestly, no
different than the java:

vector.ref(3) = new Integer(12);

or an overloading of the = operator in C++ (for example):

Complex
operator =(Complex &lhs, double rhs)
{
  lhs.real = rhs;
  lhs.imaginary = 0.0;
}

Honestly, will you actually be happy with anything any more flexible
than:

object.this_function_gets_the_value_of_x()

and

object.this_is_a_different_function_that_is_supposed_to_set_the_x_value_but_really_formats_the_harddrive(int x)

  -Eric



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]