Search found 6 matches

by blooper
Wed May 20, 2009 8:42 pm
Forum: Scheme
Topic: Function with fixed parameter
Replies: 4
Views: 6278

Re: Function with fixed parameter

Thank you! :D Now everything works like a charm! :)
by blooper
Wed May 20, 2009 6:56 pm
Forum: Scheme
Topic: Function with fixed parameter
Replies: 4
Views: 6278

Re: Function with fixed parameter

Are you sure that &rest directive is acceptable in Scheme or is it just available in CL? I've tried to used it DrScheme with R5RS language turned on, but it doesn't work as it should have - it is trying to take &rest as if it was one of the arguments... :(
by blooper
Wed May 20, 2009 7:07 am
Forum: Scheme
Topic: Function with fixed parameter
Replies: 4
Views: 6278

Function with fixed parameter

How one can write in Scheme function Fix-first-parameter and Fix-second-parameter that for given function F of n arguments (parameters) and given number A, will return a new function (lets donote if by G) of (n-1) arguments (parameters), such that: G(x_1, x_2, x_3, ..., x_n-1) = F(a, x_1, x_2, x_3, ...
by blooper
Wed May 20, 2009 6:34 am
Forum: Scheme
Topic: Computing two dimensional functions
Replies: 5
Views: 8373

Re: Computing two dimensional functions

Thanks for the hint, but I still can't write the appropriate function. :-( Scheme seems to be too abstract for me...

But thank you anyway. :-)
by blooper
Sun May 17, 2009 3:55 am
Forum: Scheme
Topic: Computing two dimensional functions
Replies: 5
Views: 8373

Re: Computing two dimensional functions

Thanks for your solution. :) But is there any way to change it, so it will work with lists of pairs (with dot inside)? :?: (I cannot change the way in which input is passed to the function.)
by blooper
Thu May 14, 2009 10:36 pm
Forum: Scheme
Topic: Computing two dimensional functions
Replies: 5
Views: 8373

Computing two dimensional functions

How one can write a function "map2D" that will be a 2-dimensional equivalent of the standard "map" function? In other words, I like it to work like in the following example: Line: (map2D + '((1 . 2) (3 . 4) (5 . 6)) ) should return a result: (3 7 11) because: 1 + 2 = 3, or equivalently: (+ 1 2) == 3...