From: ·······@cad.strath.ac.uk
Subject: How to take out h and v value in #_Lineto?
Date: 
Message-ID: <8utn0p$qfl$1@nnrp1.deja.com>
Hello,

I am trying to get a value of h and v in #_lineto (MCL's quickdraw function)
as

    (#_lineto (point-h where) (point-v where))
    () ; take out point-h and point-v
    (setf first-x point-h)
    (setf first-y point-v)

However, in the definition, #_lineto does not return any value.
How can I get the h and v coordinates?

Sungwoo


Sent via Deja.com http://www.deja.com/
Before you buy.

From: Rainer Joswig
Subject: Re: How to take out h and v value in #_Lineto?
Date: 
Message-ID: <joswig-C6E9E9.02170216112000@news.is-europe.net>
In article <············@nnrp1.deja.com>, ·······@cad.strath.ac.uk 
wrote:

> Hello,
> 
> I am trying to get a value of h and v in #_lineto (MCL's quickdraw function)
> as

I don't fully understand the question...

>     (#_lineto (point-h where) (point-v where))
>     () ; take out point-h and point-v
>     (setf first-x point-h)
>     (setf first-y point-v)
> 
> However, in the definition, #_lineto does not return any value.

Why should LineTo return a value? What value?

> How can I get the h and v coordinates?

You already have the point WHERE - so why don't get
you get it from there?

> Sungwoo

The value of WHERE is a point, yes?

(point-h where) returns the horizontal component of the point.
(point-v where) returns the vertical component of the point.

-- 
Rainer Joswig, Hamburg, Germany
Email: ·············@corporate-world.lisp.de
Web: http://corporate-world.lisp.de/
From: ·······@cad.strath.ac.uk
Subject: Oops.....
Date: 
Message-ID: <8v0csh$11g$1@nnrp1.deja.com>
In article <····························@news.is-europe.net>,
  Rainer Joswig <······@corporate-world.lisp.de> wrote:
> In article <············@nnrp1.deja.com>, ·······@cad.strath.ac.uk
> wrote:
>
> > Hello,
> >
> > I am trying to get a value of h and v in #_lineto (MCL's quickdraw function)
> > as
>
> I don't fully understand the question...
>
> >     (#_lineto (point-h where) (point-v where))
> >     () ; take out point-h and point-v
> >     (setf first-x point-h)
> >     (setf first-y point-v)
> >
> > However, in the definition, #_lineto does not return any value.
>
> Why should LineTo return a value? What value?
>
> > How can I get the h and v coordinates?
>
> You already have the point WHERE - so why don't get
> you get it from there?
>
> > Sungwoo
>
> The value of WHERE is a point, yes?
>
> (point-h where) returns the horizontal component of the point.
> (point-v where) returns the vertical component of the point.
>
> --
> Rainer Joswig, Hamburg, Germany
> Email: ·············@corporate-world.lisp.de
> Web: http://corporate-world.lisp.de/
>

I was fully silly.
I thought the point-h and point-v are points rather than (point-h where).
That's why I couldn't get the result at all.
After changed like below, now it works. =)

  (#_lineto (point-h pos) (point-v pos))
              (setf next-x (point-h pos))
              (setf next-y (point-v pos))

Thanks alot.

Sungwoo


Sent via Deja.com http://www.deja.com/
Before you buy.
From: John Clonts
Subject: Re: Oops.....
Date: 
Message-ID: <3A13EFF6.5D94@my-deja.com>
·······@cad.strath.ac.uk wrote:
> 
[snip]
> In article <····························@news.is-europe.net>,
> After changed like below, now it works. =)
> 
>   (#_lineto (point-h pos) (point-v pos))
>               (setf next-x (point-h pos))
>               (setf next-y (point-v pos))
> 

Might I recommend instead

  (setf next-x (point-h pos))
  (setf next-y (point-v pos))
  (#_lineto next-x next-y)

Cheers,
John
From: ·······@cad.strath.ac.uk
Subject: I see....
Date: 
Message-ID: <8v11i2$hmh$1@nnrp1.deja.com>
In article <·············@my-deja.com>,
  ······@my-deja.com wrote:
> ·······@cad.strath.ac.uk wrote:
> >
> [snip]
> > In article <····························@news.is-europe.net>,
> > After changed like below, now it works. =)
> >
> >   (#_lineto (point-h pos) (point-v pos))
> >               (setf next-x (point-h pos))
> >               (setf next-y (point-v pos))
> >
>
> Might I recommend instead
>
>   (setf next-x (point-h pos))
>   (setf next-y (point-v pos))
>   (#_lineto next-x next-y)
>
> Cheers,
> John
>

I see.... that code seems much optimsed for performance...
For a small sketching behaviour, I can't measure how much increase the speed.
but maybe I can realise the difference with complex sketches and tasks....?
Can this code save some memory as well or not?
(or,,, maybe I don't have to worry about the memory usage?)

I don't know exactly what will be different between two coding type. (Plz
remember, I am a newbie. =)) Would you let me know the difference (speed or
memory or something else..)?

Sungwoo


Sent via Deja.com http://www.deja.com/
Before you buy.
From: Rainer Joswig
Subject: Re: I see....
Date: 
Message-ID: <joswig-2789F1.18332916112000@news.is-europe.net>
In article <············@nnrp1.deja.com>, ·······@cad.strath.ac.uk 
wrote:

> In article <·············@my-deja.com>,
>   ······@my-deja.com wrote:
> > ·······@cad.strath.ac.uk wrote:
> > >
> > [snip]
> > > In article <····························@news.is-europe.net>,
> > > After changed like below, now it works. =)
> > >
> > >   (#_lineto (point-h pos) (point-v pos))
> > >               (setf next-x (point-h pos))
> > >               (setf next-y (point-v pos))
> > >
> >
> > Might I recommend instead
> >
> >   (setf next-x (point-h pos))
> >   (setf next-y (point-v pos))
> >   (#_lineto next-x next-y)
> >
> > Cheers,
> > John
> >
> 
> I see.... that code seems much optimsed for performance...
> For a small sketching behaviour, I can't measure how much increase the speed.
> but maybe I can realise the difference with complex sketches and tasks....?
> Can this code save some memory as well or not?
> (or,,, maybe I don't have to worry about the memory usage?)
> 
> I don't know exactly what will be different between two coding type. (Plz
> remember, I am a newbie. =)) Would you let me know the difference (speed or
> memory or something else..)?

It doesn't matter that much.

You can also do:

> >   (setf next-x (point-h pos))
> >   (setf next-y (point-v pos))
> >   (#_lineto next-x next-y)
>

(#_lineto (setf next-x (point-h pos))
          (setf next-y (point-v pos)))

Most of the time you won't see any difference. So forget
about it for now.

-- 
Rainer Joswig, Hamburg, Germany
Email: ·············@corporate-world.lisp.de
Web: http://corporate-world.lisp.de/
From: ·······@cad.strath.ac.uk
Subject: Re: I see....
Date: 
Message-ID: <8v1aam$ppf$1@nnrp1.deja.com>
In article <····························@news.is-europe.net>,
  Rainer Joswig <······@corporate-world.lisp.de> wrote:
> In article <············@nnrp1.deja.com>, ·······@cad.strath.ac.uk
> wrote:
>
> > In article <·············@my-deja.com>,
> >   ······@my-deja.com wrote:
> > > ·······@cad.strath.ac.uk wrote:
> > > >
> > > [snip]
> > > > In article <····························@news.is-europe.net>,
> > > > After changed like below, now it works. =)
> > > >
> > > >   (#_lineto (point-h pos) (point-v pos))
> > > >               (setf next-x (point-h pos))
> > > >               (setf next-y (point-v pos))
> > > >
> > >
> > > Might I recommend instead
> > >
> > >   (setf next-x (point-h pos))
> > >   (setf next-y (point-v pos))
> > >   (#_lineto next-x next-y)
> > >
> > > Cheers,
> > > John
> > >
> >
> > I see.... that code seems much optimsed for performance...
> > For a small sketching behaviour, I can't measure how much increase the speed.
> > but maybe I can realise the difference with complex sketches and tasks....?
> > Can this code save some memory as well or not?
> > (or,,, maybe I don't have to worry about the memory usage?)
> >
> > I don't know exactly what will be different between two coding type. (Plz
> > remember, I am a newbie. =)) Would you let me know the difference (speed or
> > memory or something else..)?
>
> It doesn't matter that much.
>
> You can also do:
>
> > >   (setf next-x (point-h pos))
> > >   (setf next-y (point-v pos))
> > >   (#_lineto next-x next-y)
> >
>
> (#_lineto (setf next-x (point-h pos))
>           (setf next-y (point-v pos)))
>
> Most of the time you won't see any difference. So forget
> about it for now.
>
> --
> Rainer Joswig, Hamburg, Germany
> Email: ·············@corporate-world.lisp.de
> Web: http://corporate-world.lisp.de/
>

I see. Thanks alot, =)

Sungwoo


Sent via Deja.com http://www.deja.com/
Before you buy.
From: Keke Abe
Subject: Re: How to take out h and v value in #_Lineto?
Date: 
Message-ID: <keke-1611001431470001@solg4.keke.org>
In article <············@nnrp1.deja.com>, ·······@cad.strath.ac.uk wrote:

> I am trying to get a value of h and v in #_lineto (MCL's quickdraw function)
> as
> 
>     (#_lineto (point-h where) (point-v where))
>     () ; take out point-h and point-v
>     (setf first-x point-h)
>     (setf first-y point-v)
> 
> However, in the definition, #_lineto does not return any value.
> How can I get the h and v coordinates?

???

(#_lineto h v) draws a line from the point whereever the pen was
located before to the point you specify with h and v, and leaves
the pen at ·@(h v) afterwards.

    (progn
      (#_moveto 0 0)        ; move the pen without drawing
      (#_lineto 100 100))

Above code draws a line from ·@(0 0) to ·@(100 100).

abe