Author Topic: does anyone here know scheme  (Read 1304 times)

0 Members and 3 Guests are viewing this topic.

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
does anyone here know scheme
I have a class where it is used as the primary language and I'd like someone who is reasonably proficient with it so that I may pester them with mundane questions.
« Last Edit: January 22, 2008, 04:33:20 am by Bobboau »
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline TrashMan

  • T-tower Avenger. srsly.
  • 213
  • God-Emperor of your kind!
    • FLAMES OF WAR
Re: does anyone here know scheme
SCHEME? I remember that one ...faintly..hm.. I might have my scrips lying somewhere...

I just hate it when they make you go trough 20 programing languages really fast... Just when you started to grasp it - BANG - here comes a new one, forget the old one. I know it's just to get understanding on how programing works and how it has evolved, but damn..what's the point in learning a language if I'm gonna forget about it 2 weeks from now.
Nobody dies as a virgin - the life ****s us all!

You're a wrongularity from which no right can escape!

 

Offline Mika

  • 28
Re: does anyone here know scheme
I know something of a derivative of it. I hate the whole language, but I don't really have choice, so post your mundane questions so we can ponder them together.

Mika
Relaxed movement is always more effective than forced movement.

 

Offline Kosh

  • A year behind what's funny
  • 210
Re: does anyone here know scheme
What class is it used for?
"The reason for this is that the original Fortran got so convoluted and extensive (10's of millions of lines of code) that no-one can actually figure out how it works, there's a massive project going on to decode the original Fortran and write a more modern system, but until then, the UK communication network is actually relying heavily on 35 year old Fortran that nobody understands." - Flipside

Brain I/O error
Replace and press any key

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: does anyone here know scheme
If you post them here, I'll take a look as well. There's a chance that I may need to take an entire class devoted to LISP. Dunno if I can do much more than offer ideas though.

I've been pestered with mundane questions on LISP before, but the guy didn't know near as much about programming as you do. :p
-C

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: does anyone here know scheme
 mundane I mean really basic **** like how are objects represented, if I want to define a (3d) vector class for instance, how would I do that, and how would I access the x, y, and z components?

all the stuff I've seen I see nothing that is immediately parallel to a structure, especially with that dynamic typing going on.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Mika

  • 28
Re: does anyone here know scheme
Hi

Regarding vectors and referring to them, I think I know something about that stuff. But patience, I'll reply tomorrow about that since I have to use the laptop provided by the company and not the home computer.

Mika
Relaxed movement is always more effective than forced movement.

  

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: does anyone here know scheme
well I didn't mean vectors specifically I meant any sort of structure (also, just to be clear, I was also referring to the 3d point not the resizeable array)
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Re: does anyone here know scheme
SCHEME?!  :confused:

SCHEME?!

tell the professor to put the crackpipe down
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: does anyone here know scheme
it's a programing languages class, the idea was something along the lines of finding a language that was "interesting".

scheme has some very "interesting" syntax and paradigms.

and I can see it being useful as a small scale scripting language.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Mika

  • 28
Re: does anyone here know scheme
Here is something I wrote some time ago, I'm not sure if it is exactly the same dialect though. Would it answer some of your questions?

------------------
(do
  ((i -1 (+ i 1)))
  ((= i 359))
  (do:something-clever-here)
  (raytrace:set-direction-vectors (gvector 0 1 0) (gvector 0 0 1))
  (do:something-clever-again)
  (analysis:save-data (string-append "c:/your_stuff_here/file" (number->string
  i) ".txt"))
  (print (string-append "Tilt degree: " (number->string i)))
)
-----------------------------

For vectors, would something like (list 1 2 3 4) do? And then applying list->vector? Though I'm sure there are some better ways than first creating a list object and transferring it to vector. But I recall having had to insert some 150 B-Spline control points into the software, and creating a surface out of that had several steps like control-point-grid->surface. I was pretty amazed that I indeed couldn't delete the control-point-grid after the "surface" was created.

Factorial function
-----------------------------------
(define fact
  (lambda (num) ; This I'm not sure, this could be because of the Scheme dialect I use
     (let ((val 1))
        (do
             ((i num (- i 1)))
             ((= i 0)
        (print val))
        (set! val (* val i))))))

-----------------------------------

Something about vectors:

(define V (vector 0 'a "b" '(a b c)))
;then running V will result in #(0 a "b" (a b c))
;Changing of the vector component
(vector-set! V 3 #\c)
; then running V will result in #(0 a "b" #\c)

(make-vector 3 '#(a "B")) ;running this would result in #(#(a "B") #(a "B")  #(a "B"))

I think I never even tried to do anything with matrices in Scheme.

BTW, does this help at all?

Mika
Relaxed movement is always more effective than forced movement.

 

Offline Mika

  • 28
Re: does anyone here know scheme
Yeah, personally I hold Scheme as an example of how NOT to construct programming language. Even with the factorial example I had hard time following what it is actually doing. And I also say I so much love the amount of parentheses in the code. The personal favorite error when constructing a program are of course missing parentheses, when that happens the software the code runs usually goes down in a big boom.

Mika
Relaxed movement is always more effective than forced movement.