From: justmehere
Subject: Lisp newbie need help with parsing a string
Date: 
Message-ID: <1169344790.599793.200420@a75g2000cwd.googlegroups.com>
I need to be able to do this without any built in string procedures.
What I need help with if anyone can just point me in the right
direction on how to get a sub string from a string. So for example if
you have "Hello my name is joey" I want to be able to parse like what
Perl can do with split that is I want to be able to access any of the
sub strings all separated by the space character.

Again I am not looking for any source code but just getting to the
right direction. I just started learning lisp just less then one week.
Have very little knowledge so far.

Any tutorial links on parsing strings or getting sub strings would be
the best for me and thanks

From: justmehere
Subject: Re: Lisp newbie need help with parsing a string
Date: 
Message-ID: <1169352168.052535.158100@q2g2000cwa.googlegroups.com>
justmehere wrote:
> I need to be able to do this without any built in string procedures.
> What I need help with if anyone can just point me in the right
> direction on how to get a sub string from a string. So for example if
> you have "Hello my name is joey" I want to be able to parse like what
> Perl can do with split that is I want to be able to access any of the
> sub strings all separated by the space character.
>
> Again I am not looking for any source code but just getting to the
> right direction. I just started learning lisp just less then one week.
> Have very little knowledge so far.
>
> Any tutorial links on parsing strings or getting sub strings would be
> the best for me and thanks

Thanks to both replies both very helpful and yes I'm learning scheme
and then prolog in shool for a course that I have to take.
From: justmehere
Subject: Re: Lisp newbie need help with parsing a string
Date: 
Message-ID: <1169353171.883192.35800@v45g2000cwv.googlegroups.com>
justmehere wrote:
> I need to be able to do this without any built in string procedures.
> What I need help with if anyone can just point me in the right
> direction on how to get a sub string from a string. So for example if
> you have "Hello my name is joey" I want to be able to parse like what
> Perl can do with split that is I want to be able to access any of the
> sub strings all separated by the space character.
>
> Again I am not looking for any source code but just getting to the
> right direction. I just started learning lisp just less then one week.
> Have very little knowledge so far.
>
> Any tutorial links on parsing strings or getting sub strings would be
> the best for me and thanks

Hello I tried out using all of the functions above like aref and subseq
and Dr Scheme won't recognize it the keyword. I have tried the other
language selections but still get the following error
"reference to undefined identifier: subseq"

Any help would be apppreciated.
From: Ken Tilton
Subject: Re: Lisp newbie need help with parsing a string
Date: 
Message-ID: <CZBsh.223$yS1.211@newsfe11.lga>
justmehere wrote:
> justmehere wrote:
> 
>>I need to be able to do this without any built in string procedures.
>>What I need help with if anyone can just point me in the right
>>direction on how to get a sub string from a string. So for example if
>>you have "Hello my name is joey" I want to be able to parse like what
>>Perl can do with split that is I want to be able to access any of the
>>sub strings all separated by the space character.
>>
>>Again I am not looking for any source code but just getting to the
>>right direction. I just started learning lisp just less then one week.
>>Have very little knowledge so far.
>>
>>Any tutorial links on parsing strings or getting sub strings would be
>>the best for me and thanks
> 
> 
> Hello I tried out using all of the functions above like aref and subseq
> and Dr Scheme won't recognize it the keyword. I have tried the other
> language selections but still get the following error
> "reference to undefined identifier: subseq"
> 
> Any help would be apppreciated.
> 

yer in the wrong NG. try c.l.scheme. scheme is in the lisp /family/, but 
if yer talkin syntax "family" is not close enough.

kt


-- 
The Dalai Lama gets the same crap all the time.
   -- Kenny Tilton on c.l.l when accused of immodesty
From: justmehere
Subject: Re: Lisp newbie need help with parsing a string
Date: 
Message-ID: <1169390471.657672.91020@v45g2000cwv.googlegroups.com>
Ken Tilton wrote:
> justmehere wrote:
> > justmehere wrote:
> >
> >>I need to be able to do this without any built in string procedures.
> >>What I need help with if anyone can just point me in the right
> >>direction on how to get a sub string from a string. So for example if
> >>you have "Hello my name is joey" I want to be able to parse like what
> >>Perl can do with split that is I want to be able to access any of the
> >>sub strings all separated by the space character.
> >>
> >>Again I am not looking for any source code but just getting to the
> >>right direction. I just started learning lisp just less then one week.
> >>Have very little knowledge so far.
> >>
> >>Any tutorial links on parsing strings or getting sub strings would be
> >>the best for me and thanks
> >
> >
> > Hello I tried out using all of the functions above like aref and subseq
> > and Dr Scheme won't recognize it the keyword. I have tried the other
> > language selections but still get the following error
> > "reference to undefined identifier: subseq"
> >
> > Any help would be apppreciated.
> >
>
> yer in the wrong NG. try c.l.scheme. scheme is in the lisp /family/, but
> if yer talkin syntax "family" is not close enough.
>
> kt
>
>
> --
> The Dalai Lama gets the same crap all the time.
>    -- Kenny Tilton on c.l.l when accused of immodesty


Ok will do sorry for not mentioning that I was working with Scheme.
From: justmehere
Subject: Re: Lisp newbie need help with parsing a string
Date: 
Message-ID: <1169400432.613410.107520@q2g2000cwa.googlegroups.com>
Ken Tilton wrote:
> justmehere wrote:
> > justmehere wrote:
> >
> >>I need to be able to do this without any built in string procedures.
> >>What I need help with if anyone can just point me in the right
> >>direction on how to get a sub string from a string. So for example if
> >>you have "Hello my name is joey" I want to be able to parse like what
> >>Perl can do with split that is I want to be able to access any of the
> >>sub strings all separated by the space character.
> >>
> >>Again I am not looking for any source code but just getting to the
> >>right direction. I just started learning lisp just less then one week.
> >>Have very little knowledge so far.
> >>
> >>Any tutorial links on parsing strings or getting sub strings would be
> >>the best for me and thanks
> >
> >
> > Hello I tried out using all of the functions above like aref and subseq
> > and Dr Scheme won't recognize it the keyword. I have tried the other
> > language selections but still get the following error
> > "reference to undefined identifier: subseq"
> >
> > Any help would be apppreciated.
> >
>
> yer in the wrong NG. try c.l.scheme. scheme is in the lisp /family/, but
> if yer talkin syntax "family" is not close enough.
>
> kt
>
>
> --
> The Dalai Lama gets the same crap all the time.
>    -- Kenny Tilton on c.l.l when accused of immodesty


Sorry to be a both Keith but I cannot locate the news group c.l.scheme
from Google Groups or from my own ISP list news server list of groups ?
Where can I acces that group please ?
From: Ken Tilton
Subject: Re: Lisp newbie need help with parsing a string
Date: 
Message-ID: <ulPsh.19$9S.12@newsfe11.lga>
justmehere wrote:
> Ken Tilton wrote:
> 
>>justmehere wrote:
>>
>>>justmehere wrote:
>>>
>>>
>>>>I need to be able to do this without any built in string procedures.
>>>>What I need help with if anyone can just point me in the right
>>>>direction on how to get a sub string from a string. So for example if
>>>>you have "Hello my name is joey" I want to be able to parse like what
>>>>Perl can do with split that is I want to be able to access any of the
>>>>sub strings all separated by the space character.
>>>>
>>>>Again I am not looking for any source code but just getting to the
>>>>right direction. I just started learning lisp just less then one week.
>>>>Have very little knowledge so far.
>>>>
>>>>Any tutorial links on parsing strings or getting sub strings would be
>>>>the best for me and thanks
>>>
>>>
>>>Hello I tried out using all of the functions above like aref and subseq
>>>and Dr Scheme won't recognize it the keyword. I have tried the other
>>>language selections but still get the following error
>>>"reference to undefined identifier: subseq"
>>>
>>>Any help would be apppreciated.
>>>
>>
>>yer in the wrong NG. try c.l.scheme. scheme is in the lisp /family/, but
>>if yer talkin syntax "family" is not close enough.
>>
>>kt
>>
>>
>>--
>>The Dalai Lama gets the same crap all the time.
>>   -- Kenny Tilton on c.l.l when accused of immodesty
> 
> 
> 
> Sorry to be a both Keith but I cannot locate the news group c.l.scheme
> from Google Groups or from my own ISP list news server list of groups ?
> Where can I acces that group please ?
> 

comp.lang.scheme

(NG regulars usually abbreviate up to the last (or even the last, as in 
my sig).)

kt

-- 
The Dalai Lama gets the same crap all the time.
   -- Kenny Tilton on c.l.l when accused of immodesty
From: justmehere
Subject: Re: Lisp newbie need help with parsing a string
Date: 
Message-ID: <1169416762.585508.298180@l53g2000cwa.googlegroups.com>
Ken Tilton wrote:
> justmehere wrote:
> > Ken Tilton wrote:
> >
> >>justmehere wrote:
> >>
> >>>justmehere wrote:
> >>>
> >>>
> >>>>I need to be able to do this without any built in string procedures.
> >>>>What I need help with if anyone can just point me in the right
> >>>>direction on how to get a sub string from a string. So for example if
> >>>>you have "Hello my name is joey" I want to be able to parse like what
> >>>>Perl can do with split that is I want to be able to access any of the
> >>>>sub strings all separated by the space character.
> >>>>
> >>>>Again I am not looking for any source code but just getting to the
> >>>>right direction. I just started learning lisp just less then one week.
> >>>>Have very little knowledge so far.
> >>>>
> >>>>Any tutorial links on parsing strings or getting sub strings would be
> >>>>the best for me and thanks
> >>>
> >>>
> >>>Hello I tried out using all of the functions above like aref and subseq
> >>>and Dr Scheme won't recognize it the keyword. I have tried the other
> >>>language selections but still get the following error
> >>>"reference to undefined identifier: subseq"
> >>>
> >>>Any help would be apppreciated.
> >>>
> >>
> >>yer in the wrong NG. try c.l.scheme. scheme is in the lisp /family/, but
> >>if yer talkin syntax "family" is not close enough.
> >>
> >>kt
> >>
> >>
> >>--
> >>The Dalai Lama gets the same crap all the time.
> >>   -- Kenny Tilton on c.l.l when accused of immodesty
> >
> >
> >
> > Sorry to be a both Keith but I cannot locate the news group c.l.scheme
> > from Google Groups or from my own ISP list news server list of groups ?
> > Where can I acces that group please ?
> >
>
> comp.lang.scheme
>
> (NG regulars usually abbreviate up to the last (or even the last, as in
> my sig).)
>
> kt
>
> --
> The Dalai Lama gets the same crap all the time.
>    -- Kenny Tilton on c.l.l when accused of immodesty

Many thanks again.
From: Ken Tilton
Subject: Re: Lisp newbie need help with parsing a string
Date: 
Message-ID: <%AAsh.68$V71.23@newsfe08.lga>
justmehere wrote:
> I need to be able to do this without any built in string procedures.
> What I need help with if anyone can just point me in the right
> direction on how to get a sub string from a string. So for example if
> you have "Hello my name is joey" I want to be able to parse like what
> Perl can do with split that is I want to be able to access any of the
> sub strings all separated by the space character.
> 
> Again I am not looking for any source code but just getting to the
> right direction. I just started learning lisp just less then one week.
> Have very little knowledge so far.
> 
> Any tutorial links on parsing strings or getting sub strings would be
> the best for me and thanks
> 

OK, if you cannot use built-in string stuff this must be school work, 
meaning you just need some other way to take apart strings. That is 
easy, a string is a subtype of array, use aref to get at a string 
element, length to tell how many characters there are.

A string is also a sequence ... can you use things like subseq? If not, 
you need to gather characters in a list and then coerce to a string.

hth, kt


-- 
The Dalai Lama gets the same crap all the time.
   -- Kenny Tilton on c.l.l when accused of immodesty
From: Zach Beane
Subject: Re: Lisp newbie need help with parsing a string
Date: 
Message-ID: <m34pqlt7ef.fsf@unnamed.xach.com>
"justmehere" <···········@yahoo.com> writes:

> I need to be able to do this without any built in string procedures.
> What I need help with if anyone can just point me in the right
> direction on how to get a sub string from a string. So for example if
> you have "Hello my name is joey" I want to be able to parse like what
> Perl can do with split that is I want to be able to access any of the
> sub strings all separated by the space character.

SUBSEQ extracts a subsequence from a sequence, and strings are defined
as sequences of characters. For example:

  (subseq "Hello my name is joey" 0 5) => "Hello"

POSITION returns the sequence index of a particular element. For
example:

  (position #\Space "Hello my name is joey") => 5

Hope this gives you some ideas,
Zach