Noob needs current tutorial please

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Noob needs current tutorial please

Duke Normandin
Hello & Happy New Year!

I'm new to Chicken Scheme. I've got some exposure to newLISP and
Gambit-C. I'm continueing my test-drive of Chicken because it
produced the smallest executable for helloworld.scm.

However, I'm having a bitch of a time finding a tutorial with
example code that is current to the most recent version of Chicken.
For example: at http://wiki.call-cc.org/friendly-chicken
one of the examples is:

#;1> (use utf8)

It barfs up:

Error: unbound variable: use

        Call history:

        <syntax>          (use utf8)
        <eval>    (use utf8)    <--

and the list goes on!

Any recent tutorials for Chicken out there? TIA ..
--
Duke


Reply | Threaded
Open this post in threaded view
|

Re: Noob needs current tutorial please

George Oliver
On Sat, Jan 9, 2021 at 6:51 PM Duke Normandin <[hidden email]> wrote:
>
> Any recent tutorials for Chicken out there? TIA ..

hi Duke, unfortunately that example you linked is using version 4
Chicken (note the version in the header of the file). Importing
packages changed in Chicken 5. I recommend this page for a better
getting started tutorial,

http://wiki.call-cc.org/man/5/Getting%20started

Note the '5' in the URL, you'll see that for API docs, eggs, etc.

cheers, George

Reply | Threaded
Open this post in threaded view
|

Re: Noob needs current tutorial please

André Sá
In reply to this post by Duke Normandin
On 1/10/21 2:51 AM, Duke Normandin wrote:

> Hello & Happy New Year!
>
> I'm new to Chicken Scheme. I've got some exposure to newLISP and
> Gambit-C. I'm continueing my test-drive of Chicken because it
> produced the smallest executable for helloworld.scm.
>
> However, I'm having a bitch of a time finding a tutorial with
> example code that is current to the most recent version of Chicken.
> For example: at http://wiki.call-cc.org/friendly-chicken
> one of the examples is:
>
> #;1> (use utf8)
>
> It barfs up:
>
> Error: unbound variable: use
>
>          Call history:
>
>          <syntax>          (use utf8)
>          <eval>    (use utf8)    <--
>
> and the list goes on!
>
> Any recent tutorials for Chicken out there? TIA ..
> --
> Duke
>
>

Hey there!

 From a quick glance, it seems that page is for CHICKEN 4 (the current
version is 5). I think the only differences from that page are that
instead of `use` you should now use `import`, and that the `numbers` egg
is no longer needed to have a full numeric tower support.

As far as a "full" tutorial goes, I'm not in on it, but someone else may
give you some help on that front.

For differences between C4 and C5 you may want to take a look at this[0]
page. Some other possibly useful links are The Manual[1] and the
documentation[2] for the core language and all the eggs.

Hope this helps!

[0]: https://wiki.call-cc.org/porting-c4-to-c5
[1]: https://wiki.call-cc.org/man/5/The%20User%27s%20Manual
[2]: https://api.call-cc.org/5/doc/

André Sá



Reply | Threaded
Open this post in threaded view
|

Re: Noob needs current tutorial please

Duke Normandin
In reply to this post by George Oliver
On Sat, 9 Jan 2021 19:13:18 -0800
George Oliver wrote:

> On Sat, Jan 9, 2021 at 6:51 PM Duke Normandin
> <[hidden email]> wrote:
> >
> > Any recent tutorials for Chicken out there? TIA ..
>
> hi Duke, unfortunately that example you linked is using version 4
> Chicken (note the version in the header of the file). Importing
> packages changed in Chicken 5. I recommend this page for a better
> getting started tutorial,
>
> http://wiki.call-cc.org/man/5/Getting%20started

Thank you very much George for the link and quick reply! I'll give
it another shot using "import" now that I know better.

I also had an issue with installing Chicken. To whom should I
address the hiccup to? Thanks again!
--
Duke

Reply | Threaded
Open this post in threaded view
|

Re: Noob needs current tutorial please

Duke Normandin
In reply to this post by André Sá
On Sun, 10 Jan 2021 03:16:36 +0000
André Sá wrote:

> On 1/10/21 2:51 AM, Duke Normandin wrote:
> > Hello & Happy New Year!
> >
> > I'm new to Chicken Scheme. I've got some exposure to newLISP and
> > Gambit-C. I'm continueing my test-drive of Chicken because it
> > produced the smallest executable for helloworld.scm.
> >
> > However, I'm having a bitch of a time finding a tutorial with
> > example code that is current to the most recent version of
> > Chicken. For example: at
> > http://wiki.call-cc.org/friendly-chicken one of the examples is:

[snip]

>  From a quick glance, it seems that page is for CHICKEN 4 (the
> current version is 5). I think the only differences from that
> page are that instead of `use` you should now use `import`, and
> that the `numbers` egg is no longer needed to have a full numeric
> tower support.

Good to know! Thanks. Those "old" docs in all languages get me
everytime!

Thanks for the links! I'm sure that it will help!
--
Duke

Reply | Threaded
Open this post in threaded view
|

Re: Noob needs current tutorial please

Duke Normandin
In reply to this post by Duke Normandin
Follow-up ...

The code executed without a burp! :-) However ...

c:\> csi -ss quickrep.scm <quickrep.dat 'a.*c' A
xyzabcghi
abxawxcgh
foonly

Something went off the rails! The regex did NOT work. The script
simply spit the input back out. ad it worked, the output would have
been:
xyzAghi
Agh
foonly

I'm on a Windoze10 box. Could that somehow be the problem?
--
Duke

Reply | Threaded
Open this post in threaded view
|

Re: Noob needs current tutorial please

Stefan Schmiedl
"Duke Normandin" <[hidden email]>, 10.01.2021, 05:05:

> Follow-up ...

> The code executed without a burp! :-) However ...

c:\>> csi -ss quickrep.scm <quickrep.dat 'a.*c' A
> xyzabcghi
> abxawxcgh
> foonly

> Something went off the rails! The regex did NOT work. The script
> simply spit the input back out. ad it worked, the output would have
> been:
> xyzAghi
> Agh
> foonly

> I'm on a Windoze10 box. Could that somehow be the problem?

Hi Duke,

strictly speaking, it's probably cmd.exe's fault, as it is similar
but not identical to shell behaviour. While I/O redirection works
the same way with <, >, 2>, cmd.exe does not do globbing, i.e.
expansion of wildcard patterns. Instead it passes the arguments
straight to the program handling them. Also, AFAIR it only uses
" for quoting, not '. powershell might show different behaviour.

So I'd expect that csi did not receive

        a.*c
        A

as commandline arguments but

        'a.*c'
        A

which would not match the input you've provided.

Write a program echoing its commandline arguments to stdout
and then feed it with different types of arguments:

csi -ss echo.scm a b A 123 a.*c 'a.*c' "d e f" 'g h i' j\ k

to test which of your assumptions with respect to arguments hold.

HTH,
s.


Reply | Threaded
Open this post in threaded view
|

Re: Noob needs current tutorial please

Mario Domenech Goulart-4
In reply to this post by André Sá
On Sun, 10 Jan 2021 03:16:36 +0000 André Sá <[hidden email]> wrote:

> On 1/10/21 2:51 AM, Duke Normandin wrote:
>> Hello & Happy New Year!
>>
>> I'm new to Chicken Scheme. I've got some exposure to newLISP and
>> Gambit-C. I'm continueing my test-drive of Chicken because it
>> produced the smallest executable for helloworld.scm.
>>
>> However, I'm having a bitch of a time finding a tutorial with
>> example code that is current to the most recent version of Chicken.
>> For example: at http://wiki.call-cc.org/friendly-chicken
>> one of the examples is:
>>
>> #;1> (use utf8)
>>
>> It barfs up:
>>
>> Error: unbound variable: use
>>
>>          Call history:
>>
>>          <syntax>          (use utf8)
>>          <eval>    (use utf8)    <--
>>
>> and the list goes on!
>>
>> Any recent tutorials for Chicken out there? TIA ..
>> --
>> Duke
>>
>>
>
> Hey there!
>
> From a quick glance, it seems that page is for CHICKEN 4 (the current
> version is 5). I think the only differences from that page are that
> instead of `use` you should now use `import`, and that the `numbers`
> egg is no longer needed to have a full numeric tower support.

Indeed, that page was for CHICKEN 4.  I've adapted it to CHICKEN 5.
Thanks for spotting that.

> As far as a "full" tutorial goes, I'm not in on it, but someone else
> may give you some help on that front.

As mentioned by George Oliver in another message,
http://wiki.call-cc.org/man/5/Getting%20started can be a good intro.
Suggestions on how to improve it or suggestions on new documents with a
different approach are welcome.

> For differences between C4 and C5 you may want to take a look at
> this[0] page. Some other possibly useful links are The Manual[1] and
> the documentation[2] for the core language and all the eggs.
>
> Hope this helps!
>
> [0]: https://wiki.call-cc.org/porting-c4-to-c5
> [1]: https://wiki.call-cc.org/man/5/The%20User%27s%20Manual
> [2]: https://api.call-cc.org/5/doc/

All the best.
Mario
--
http://parenteses.org/mario

Reply | Threaded
Open this post in threaded view
|

Re: Noob needs current tutorial please

Duke Normandin
In reply to this post by Stefan Schmiedl
On Sun, 10 Jan 2021 09:56:00 +0100
Stefan Schmiedl wrote:

> "Duke Normandin" <[hidden email]>, 10.01.2021, 05:05:
>
> > Follow-up ...

[snip]

> Write a program echoing its commandline arguments to stdout
> and then feed it with different types of arguments:
>
> csi -ss echo.scm a b A 123 a.*c 'a.*c' "d e f" 'g h i' j\ k
>
> to test which of your assumptions with respect to arguments hold.

Thank you for outlining the possible issue and the test case.
If I had ANY brains at all, I would go back to a BSD or Linux box.
LOL

BTW, I am not a professional programmer! Just an old (74 yrs)
amateur hacker wanting to learn a new language in an effort
to keep the "little grey cells" functioning as normally as possible.
:-D. Thanks again!
--
Duke
Alberta, Canada

Reply | Threaded
Open this post in threaded view
|

Re: Noob needs current tutorial please

Duke Normandin
In reply to this post by Stefan Schmiedl
On Sun, 10 Jan 2021 09:56:00 +0100
Stefan Schmiedl wrote:

> "Duke Normandin" <[hidden email]>, 10.01.2021, 05:05:
>
> > Follow-up ...

[snip]

> Write a program echoing its commandline arguments to stdout
> and then feed it with different types of arguments:
>
> csi -ss echo.scm a b A 123 a.*c 'a.*c' "d e f" 'g h i' j\ k
>
> to test which of your assumptions with respect to arguments hold.

Using Windoze Powershell, the following worked:

Get-Content .\quickrep.dat | csi -ss quickrep.scm  'a.*c'
A         ?xyzAghi Agh
foonly

The traditional `<' redirection operator was nuked in favor of a
new "Get-Content" cdmlet. :(

Haven't tried to get the scheme script working on plain cmd shell.
I've got Debian installed on my Win10 box. I may learn
scheme/chicken there!
--
Duke

Reply | Threaded
Open this post in threaded view
|

Re: Noob needs current tutorial please

Duke Normandin
On Sun, 10 Jan 2021 12:37:41 -0700
Duke Normandin wrote:

[snip}

> Haven't tried to get the scheme script working on plain cmd shell.
> I've got Debian installed on my Win10 box. I may learn
> scheme/chicken there!

I have now:

C:\> csi -ss quickrep.scm <quickrep.dat "a.*c" A
xyzAghi
Agh
foonly

I changed   'a.*c'  to  "a.*c" and voila! JOY!!! :-)
--
Duke