On Tue, 9 Apr 2019 at 10:29, David Kastrup wrote:
> Gianmaria Lari writes:
>
> > Ciao Harm, Andrew, Aaron and David,
> >
> > this is what I have been able to do adapting Harm code:
> >
> > \version "2.21.0"
> > foo =
> > #(let ((x '(1)))
> > (define-scheme-function (arg)(symbol?)
> > (case
Gianmaria Lari writes:
> Ciao Harm, Andrew, Aaron and David,
>
> this is what I have been able to do adapting Harm code:
>
> \version "2.21.0"
> foo =
> #(let ((x '(1)))
> (define-scheme-function (arg)(symbol?)
> (case arg
> ((incNumber) (set! x (append (drop-right x 1) (list (1+ (las
Ciao Harm, Andrew, Aaron and David,
this is what I have been able to do adapting Harm code:
\version "2.21.0"
foo =
#(let ((x '(1)))
(define-scheme-function (arg)(symbol?)
(case arg
((incNumber) (set! x (append (drop-right x 1) (list (1+ (last x))
((unindent) (drop-right! x
Hi Carl,
Am Mo., 8. Apr. 2019 um 15:05 Uhr schrieb Carl Sorensen :
> But you haven't implemented 'start in this code, have you?It's a default
> no-op. You could start your indentation by using any symbol that is not
> 'reset, 'increase, or 'indent, iIUC.
Exactly.
I should have dropped a co
Am Mo., 8. Apr. 2019 um 13:17 Uhr schrieb Aaron Hill :
>
> On 2019-04-08 2:48 am, Thomas Morley wrote:
> > foo =
> > #(let ((x (cons 1 0)))
> > (define-scheme-function (arg)(symbol?)
> > (case arg
> > ((indent) (set! x (cons (car x) (1+ (cdr x)
> > ((increase) (set! x (cons (1
On Mon, 8 Apr 2019 at 11:49, Thomas Morley wrote:
> Am Mo., 8. Apr. 2019 um 10:07 Uhr schrieb Gianmaria Lari
> :
> >
> > I try to explain what I'm trying to do.
> >
> > I want some functions helping me to numbering exercise like this:
> >
> > 1
> > 2
> > 3
> > 3.1
> > 3.2
> > 3.3
> > 4
> > 4.1
>
Aaron Hill writes:
> On 2019-04-08 4:35 am, David Kastrup wrote:
>>
>> There is no global variable x. There is a binding, but the scope of
>> the binding ends with the let. This binding is anonymous afterwards
>> and has no name. You can call functions manipulating the global
>> variable x fro
Aaron Hill writes:
> On 2019-04-08 4:08 am, David Kastrup wrote:
>> Aaron Hill writes:
>>> As such, procedures can have side effects where the objects that are
>>> passed to such procedures may be modified. Consider the 1+last!
>>> procedure I showed that is not a macro itself, but it still has
On 4/8/19, 3:48 AM, "Thomas Morley" wrote:
Am Mo., 8. Apr. 2019 um 10:07 Uhr schrieb Gianmaria Lari
:
>
> I try to explain what I'm trying to do.
>
> I want some functions helping me to numbering exercise like this:
>
> 1
> 2
> 3
> 3.1
> 3.2
On 2019-04-08 5:31 am, Andrew Bernard wrote:
Hi All,
Here's a very well written post on pointers in Scheme (it doesn't have
them, full stop). Wonderful language that it is, you can create
something
similar for yourself.
We do not have access to pointers in the Scheme language, as it is
inte
On 2019-04-08 4:08 am, David Kastrup wrote:
Aaron Hill writes:
As such, procedures can have side effects where the objects that are
passed to such procedures may be modified. Consider the 1+last!
procedure I showed that is not a macro itself, but it still has the
side effect of altering the li
Hi All,
Here's a very well written post on pointers in Scheme (it doesn't have
them, full stop). Wonderful language that it is, you can create something
similar for yourself.
https://www.quora.com/How-are-pointers-in-Scheme-different-from-C
Observe that this post also clearly states the Scheme i
Hi Aaron,
I beg to differ. Here plain and clear from the start of the R5RS Scheme
specification is the following:
Arguments to Scheme procedures are always passed by
value, which means that the actual argument expressions
are evaluated before the procedure gains control, whether
the procedure nee
On 2019-04-08 4:35 am, David Kastrup wrote:
Aaron Hill writes:
On 2019-04-08 2:48 am, Thomas Morley wrote:
foo =
#(let ((x (cons 1 0)))
(define-scheme-function (arg)(symbol?)
(case arg
((indent) (set! x (cons (car x) (1+ (cdr x)
((increase) (set! x (cons (1+ (car x)) 0))
Aaron Hill writes:
> On 2019-04-08 2:48 am, Thomas Morley wrote:
>> foo =
>> #(let ((x (cons 1 0)))
>> (define-scheme-function (arg)(symbol?)
>> (case arg
>> ((indent) (set! x (cons (car x) (1+ (cdr x)
>> ((increase) (set! x (cons (1+ (car x)) 0)))
>> ((reset) (set! x
On 2019-04-08 2:48 am, Thomas Morley wrote:
foo =
#(let ((x (cons 1 0)))
(define-scheme-function (arg)(symbol?)
(case arg
((indent) (set! x (cons (car x) (1+ (cdr x)
((increase) (set! x (cons (1+ (car x)) 0)))
((reset) (set! x (cons 1 0
(if (zero? (cdr x))
Aaron Hill writes:
> On 2019-04-07 6:01 pm, Andrew Bernard wrote:
>> I am somewhat concerned that there is a misunderstanding you have about
>> Scheme. Scheme procedures are call-by-value. This means the
>> arguments are
>> evaluated and the value then passed to the procedure. The value of the
>>
Am Mo., 8. Apr. 2019 um 10:07 Uhr schrieb Gianmaria Lari
:
>
> I try to explain what I'm trying to do.
>
> I want some functions helping me to numbering exercise like this:
>
> 1
> 2
> 3
> 3.1
> 3.2
> 3.3
> 4
> 4.1
> 4.2
>
> etc.
> I thought that an alternative approach that looks nice to try but
I try to explain what I'm trying to do.
I want some functions helping me to numbering exercise like this:
1
2
3
3.1
3.2
3.3
4
4.1
4.2
etc.
For that I thought to use the following three functions:
#(define (incNumber l) (append (drop-right l 1) (list (1+ (last l)
#(define (unindent l) (drop-
Am 8. April 2019 03:01:26 MESZ schrieb Andrew Bernard
:
>Hi Gianmaria,
>
>Can you explain the purpose of nulling out the list?
>
>I am somewhat concerned that there is a misunderstanding you have about
>Scheme. Scheme procedures are call-by-value. This means the arguments
>are
>evaluated and th
On 2019-04-07 6:01 pm, Andrew Bernard wrote:
I am somewhat concerned that there is a misunderstanding you have about
Scheme. Scheme procedures are call-by-value. This means the arguments
are
evaluated and the value then passed to the procedure. The value of the
parameter in the calling environm
Hi Gianmaria,
Can you explain the purpose of nulling out the list?
I am somewhat concerned that there is a misunderstanding you have about
Scheme. Scheme procedures are call-by-value. This means the arguments are
evaluated and the value then passed to the procedure. The value of the
parameter in
Thank you Harm and Aaron!
I tested your solutions;they both work and I think there are pretty clear!!
But I think, next days I will try to explain what I'm doing.
Thanks a lot!!!
g.
On Sat, 6 Apr 2019 at 19:09, Aaron Hill wrote:
> On 2019-04-06 9:50 am, Thomas Morley wrote:
> > Though, I'd t
On 2019-04-06 9:50 am, Thomas Morley wrote:
Though, I'd think you should rethink whatever you plan, I'm very
skeptic about always resetting a toplevel defined list.
It's too destructive.
Also, it is convention to use an exclamation point as a suffix when
naming procedures that may modify the s
Am Sa., 6. Apr. 2019 um 17:21 Uhr schrieb Gianmaria Lari
:
>
> On Sat, 6 Apr 2019 at 16:30, Thomas Morley wrote:
>> One possibility is to use a macro:
>>
>> #(define-macro (reset-list l) `(set! ,l '()))
>
>
> Thank you, it works.
>
> I tried to make the same with the second of these functions:
>
On Sat, 6 Apr 2019 at 16:30, Thomas Morley wrote:
> Am Sa., 6. Apr. 2019 um 16:11 Uhr schrieb Gianmaria Lari
> :
> >
> > I wrote this function
> >
> > #(define (resetList l) (set! l '()))
> >
> >
> > that I would like to set a list to an empty list. This is an example of
> use:
> >
> > \version "
Am Sa., 6. Apr. 2019 um 16:11 Uhr schrieb Gianmaria Lari
:
>
> I wrote this function
>
> #(define (resetList l) (set! l '()))
>
>
> that I would like to set a list to an empty list. This is an example of use:
>
> \version "2.21.0"
> #(define mylist '(1 2 3))
> \markup #(object->string mylist) %this
I wrote this function
#(define (resetList l) (set! l '()))
that I would like to set a list to an empty list. This is an example of use:
\version "2.21.0"
#(define mylist '(1 2 3))
\markup #(object->string mylist) %this prints (1 2 3)
#(define (resetList l) (set! l '()))
#(resetList mylist)
\ma
28 matches
Mail list logo