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 do I delimit an object (a compound list of things)?


hi

how do I delimit an object (a compound list of things)?
car and cdr can break into any object system that's built by list of
lists.
How do I delimit or raise some sort of boundary between "atomic"
object?
I thought of returning an function reference for the boundary, but
what if I need objects that has function references within?
Any system that I can think of requiring "sacrafies" of one type or
another.
How do I break out this lock-jem.

By the way, is there a "procedure? lambda? function?" predicate in
scheme?

I've looked at "http://www.schemers.org/Documents/Standards/R5RS/HTML/
r5rs-Z-H-9.html#%_sec_6.1"
found nothing.

thanks.

On Mar 23, 4:44 am, math.id@gmail.com wrote:

> hi

> how do I delimit an object (a compound list of things)?
> car and cdr can break into any object system that's built by list of
> lists.
> How do I delimit or raise some sort of boundary between "atomic"
> object?
> I thought of returning an function reference for the boundary, but
> what if I need objects that has function references within?
> Any system that I can think of requiring "sacrafies" of one type or
> another.
> How do I break out this lock-jem.

> By the way, is there a "procedure? lambda? function?" predicate in
> scheme?

Found "procedure?". Sorry, I weren't looking hard enough.

math.id@gmail.com writes:
> how do I delimit an object (a compound list of things)?
> car and cdr can break into any object system that's built by list of
> lists.
> How do I delimit or raise some sort of boundary between "atomic"
> object?
> I thought of returning an function reference for the boundary, but
> what if I need objects that has function references within?
> Any system that I can think of requiring "sacrafies" of one type or
> another.
> How do I break out this lock-jem.

People have used procedures for a kind of object-oriented programming:
you set up a private environment and create a procedure that provides
the only way to access that environment. I suppose the newer edition
of SICP still has the bank account example which does this.

A simple example is a counter object:

(define (make-counter)
   (let ((x 0))
      (lambda (message)
         (case message
            ((read) x)
            ((step) (set! x (+ x 1)))
            (else (error "?" message)))))) ;; but error is not R5RS!

(define c (make-counter))

(c 'step)
(c 'step)
(c 'read) => 2

There's no way to do anything else to x. It's private to c.

This is related to the origins of Scheme. Steele and Sussman were
trying to make sense of a system where "actors" passed messages to
each other, and they realized they could model it with just procedures
and procedure calls.

Implementations may have actual object systems, of course.

To the other question about types, the answer is something that didn't
quite make R5RS, or maybe it was R4RS: a mechanism for creating new
record types that are disjoint from the existing types. Check your
implementation for make-record-type or similar. Some may call them
structures.

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