Re: [racket-users] graphical debugging

2020-08-29 Thread Catonano
Il giorno sab 29 ago 2020 alle ore 12:11 Sorawee Porncharoenwase <
sorawee.pw...@gmail.com> ha scritto:

> It (kinda) works for me. You should make sure that debugging is enabled in
> the language setting (it should display something like “Language: racket,
> with debugging [custom]” in the REPL). Then, click “Debug” and then click
> “Step” for a couple of times (seven to be precise). The little green
> triangular arrow should then appear at
>
> (remove-markup
>  (open-input-string
>   "Hello, world!"))
>
>
>



Thank you very much

How do I enable debigging in the repl ?

This is all my repl shows

~$ racket
Welcome to Racket v7.7.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAJ98PDwLuSpGsx2sVhVGEnHqkAfeNNyNaENZP-Q6BKPJPt4fAQ%40mail.gmail.com.


[racket-users] graphical debugging

2020-08-29 Thread Catonano
in Drracket, I'm trying to debug this scrap of code

#lang

 racket 

(require

 racket/string sxml)

(define

 (remove-markup xml-port)
  (let*

 ((parser
  (ssax:make-parser

 NEW-LEVEL-SEED remove-markup-nls
FINISH-ELEMENT remove-markup-fe
CHAR-DATA-HANDLER remove-markup-cdh))
 (strings (parser xml-port null

)))
(string-join (reverse

 strings) "")))

(define

 (remove-markup-nls gi attributes namespaces expected-content
   seed)
  seed)

(define

 (remove-markup-fe gi attributes namespaces parent-seed seed)
  seed)

(define

 (remove-markup-cdh string-1 string-2 seed)
  (let

 ((seed (cons

 string-1 seed)))
(if

 (non-empty-string? string-2)
(cons

 string-2 seed)
seed)))

(remove-markup
 (open-input-string

  "Hello, world!"))

it's an example copied from here
https://docs.racket-lang.org/sxml/ssax.html

Reading here
https://docs.racket-lang.org/drracket/debugger.html

I understand that a little green triangular arrow should appear on the left
side of the line where the debugger stops and waits

but that doesn't happen to me, it runs completely and produces the output
(he "Hello World !" string)

am I doing anything wrong ?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAJ98PDxXRHuH47tUBSUe1PLeywAY0fRN1Y4w6kn8mubLUt0HWw%40mail.gmail.com.


Re: [racket-users] lsp server

2020-08-17 Thread Catonano
Il giorno dom 16 ago 2020 alle ore 15:48 Philip McGrath <
phi...@philipmcgrath.com> ha scritto:

> On Fri, Jul 31, 2020 at 2:46 PM Catonano  wrote:
>
>> I'm playing with a toy project in #Racket
>> <https://functional.cafe/tags/Racket>
>>
> I'd like to use the lsp server…
>>
> how do I connect to it from my Emacs based client ?
>>
>
> Just in case by "use the lsp server" you meant "set up Emacs to work on a
> Racket project" (rather than working *on* the lsp server or client), the
> generally preferred way to edit Racket in Emacs is with Greg Hendershott's
> Racket Mode (actually a package with a few major and minor modes):
> https://www.racket-mode.com
>

Thank you Phillip, I know that the preferred way is the Racket Mode

The reason why I was interested in an lsp server is not that I wanted to
use it to work on some racket based project

The reason is that I am considering implementing an lsp server myself and I
wanted to get my feet wet with the protocol and with some code dealing with
that

I wanted to use a Racket based lsp server as a training ship

Admittedly, after having seen it work, I somewhat lost interest in it

In fact, the part of the protocol is not that difficult

what is harder is the part of dealing with the language implementation to
fetch the information that needs to be sent to the client through the lsp
protocol

So there is not so much value in exploring a racked based lsp server, well,
there's less value than I have hoped

But I still am reassured that I managed to make it work, so I don't feel
like an idiot

Thanks for your help ☺


>
> -Philip
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/01000173f78714a6-5170a43f-d553-407e-89e8-db6db26d911e-00%40email.amazonses.com
> <https://groups.google.com/d/msgid/racket-users/01000173f78714a6-5170a43f-d553-407e-89e8-db6db26d911e-00%40email.amazonses.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAJ98PDyA01WpzgW%2BYZMmvG8NT-Z-gM8XY23xmqybd9W8bzAuuQ%40mail.gmail.com.


Re: [racket-users] lsp server

2020-08-15 Thread Catonano
Il giorno ven 31 lug 2020 alle ore 21:33 Stephen De Gabrielle <
spdegabrie...@gmail.com> ha scritto:

> I don’t know anything about this but I believe
>

I just found how

I need to load the main.rtk file from the lsp server project.

That will start a lsp server answering through the pipe to the process that
started it

I just didn't get the assumptions about the lsp server project and racket
in General

Thanks anyway

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAJ98PDz6KBBTQPj20uhd7Nu8r42txrMeTEJXK0ODmCJ-%3DQWu8A%40mail.gmail.com.


[racket-users] lsp server

2020-07-31 Thread Catonano
I'm playing with a toy project in #Racket


I'd like to use the lsp server

https://docs.racket-lang.org/racket-language-server/index.html

How do I do that ?

Should I require it from my project code ?

Or is it meant to be installed "globally" ?

And after that, how do I connect to it from my Emacs based client ?

Through a network socket ?

Through a Unix socket ?


Thanks in advance

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAJ98PDw7q54Kj9VyzrwRW3Ds0qHoN_7yn%2Bg7PdhJEtR84u1OEQ%40mail.gmail.com.


Re: [racket-users] Re: Andy Wingo's fold

2020-06-14 Thread Catonano
Il giorno ven 12 giu 2020 alle ore 10:57 Philip McGrath <
phi...@philipmcgrath.com> ha scritto:

> On Fri, Jun 12, 2020 at 2:46 AM Catonano  wrote:
>
>> the original paper Andy Wingo refers to uses Haskell to express this
>> operator and I can't read Haskell and I'm not willing to learn
>>
>
> I'm confused about what you mean: in the version of "Applications of Fold
> to XML Transformation", on Andy Wingo's blog
> <https://wingolog.org/pub/fold-and-xml-transformation.pdf>, all of the
> examples are in Scheme. Here is a version of the example from the paper
> that will run in Racket—most of the code is just copied and pasted from the
> figures
>


I'm referring to a paper titled: "A better XML parser through functional
programming"

by Oleg Kiselyov

I'd like to understand how exactly I'm supposed to arrange the "up" and
"down" functions that I should pass as arguments to Andy's operator

What are these operators supposed to take as arguments ?

And I was trying to start from the original paper Andy cites, because
that's where the original operator is defined (in haskell)

I know Andy's examples work

But I don't understand why they do and what I should do to apply that thing
to different use cases

i was trying to understand, not just running the examples

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAJ98PDwHPDrk8OcmKnS8FMwRiPfSY4VMFXZtMR5_gcxV6QKkWg%40mail.gmail.com.


Re: [racket-users] Re: Andy Wingo's fold

2020-06-11 Thread Catonano
Hi Stephen,

Il giorno lun 8 giu 2020 alle ore 16:34 Stephen De Gabrielle <
spdegabrie...@gmail.com> ha scritto:

> Hi Catonano
>
> Did you resolve this
>
> Kind regards
>
> Stephen
>
>
>

No, I didn't resolve this

the original paper Andy Wingo refers to uses Haskell to express this
operator and I can't read Haskell and I'm not willing to learn

My idea was to use some drawings of trees made in svg and maybe animations
of trees being processed with the original operator (the one expressed in
Haskell)

There's a scheme implementation, in my idea I would have traced it while
running and I would have prepared a graphical representation

In order to explain the operator to myself, before than to anyone else

But frankly it's a lot of work

If this thing is expressed in such a poor way, maybe its authors are not
interested in this idea being a thing

I account this to the cultural debt of the scheme community

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAJ98PDy1fUw%3Dba6FrpNukiOSMf8XFf_PEFt2hmik%3D%2Bvt9i2-mg%40mail.gmail.com.


[racket-users] folding xml - reprise

2020-03-24 Thread Catonano
Hi,

I'm trying to do something like a fold, but over a tree instead of a list.
Is there anything like that?

If it's unclear what I mean, there's a mechanism like that in guile:
https://www.gnu.org/software/guile/manual/html_node/SXML-Tree-Fold.html

They use it e.g. for XML transformations, but it's really a generic
operation and quite useful.

Here's a paper on it by Andy Wingo if anyone wants to know the theory
behind:

https://pdfs.semanticscholar.org/d41a/175cf5bf19c795b940edf566988df05ee4a1.pdf

is there anything along those lines in Racket ?

Thanks in advance

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAJ98PDyVHDnpusBQ9g%3D26J4W7GF5%2Be9krPvUCDuJHY94-17G6w%40mail.gmail.com.


[racket-users] Andy Wingo's fold

2020-03-21 Thread Catonano
Hi,
in Guile there are some modules inspired by Andy Wingos paper:
"applications of fold to xml transformation"

In Guile these concepts are used not only for xml processing but for tree
processing in general

I was wondering if anything similar is available for Racket

I'm having a hard time in processing a tree with such a fold procedure and
I could use some examples

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAJ98PDx6tN0TJg%2BE5zM4gcVHv4b%2BYbMbDBrBU7rrOQ5bND-%3DmQ%40mail.gmail.com.


Re: [racket] racket and lisp/scheme

2015-02-04 Thread Catonano
2015-02-03 22:27 GMT+01:00 Benjamin Greenman :

> Here's a quick overview of the name change (PLT Scheme -> Racket) from the
> Racket website:
> http://racket-lang.org/new-name.html
>

thank you !

  Racket Users list:
  http://lists.racket-lang.org/users


[racket] racket and lisp/scheme

2015-02-01 Thread Catonano
In what is racket different from Scheme ?

I read that the racket language is a "descendent" of Lisp and Scheme

While I know the differences between Clojure and Scheme (or Lisp) I know
nothing about racket.

Is there an overview anywhere ?

Thanks

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] machine states diagrams

2015-01-25 Thread Catonano
2014-12-02 17:03 GMT+01:00 Jens Axel Søgaard :

> Here is an example drawing a simple state machine with MetaPict.
> It shows a little state machine that accepts numbers with
> an even number of zeros in its binary representation.
>
> #lang racket
> (require metapict metapict/structs)
>
> ; Two states S1 and S2.
>
> ; Four arrows (here A1, A2, A3, A4)
> ; A1:  S1 -- 0 --> S2
> ; A2:  S2 -- 0 --> S1
> ; A3:  S1 -- 1 --> S1
> ; A4:  S2 -- 1 --> S2
>
>
Nothing happens. It returns a prompt but no window shows up

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] drawings in SICP

2015-01-25 Thread Catonano
2014-12-02 13:20 GMT+01:00 Jens Axel Søgaard :

> Is it box and pointer diagrams?
>
> If so, install metapict and let me know how this works:
>
> https://github.com/soegaard/metapict/blob/master/metapict/box-and-pointer-diagram.rkt
>
>
write method in ellipsis-snip%: arity mismatch;
 the expected number of arguments does not match the given number
  expected: 1
  given: 2
  arguments...:
   '("   1" "   (pt 0 0)" "   (pt 10 10)" "   (pt -10 -10)")
   #
  context...:

/nix/store/25c7s9jfyyjxms7zxnqxb8ncl812x3kj-racket-6.1.1/share/racket/pkgs/drracket/drracket/private/ellipsis-snip.rkt:60:4:
write method in ellipsis-snip%

/nix/store/25c7s9jfyyjxms7zxnqxb8ncl812x3kj-racket-6.1.1/share/racket/pkgs/gui-lib/mred/private/wxme/editor.rkt:1512:13
   loop

/nix/store/25c7s9jfyyjxms7zxnqxb8ncl812x3kj-racket-6.1.1/share/racket/pkgs/gui-lib/mred/private/wxme/editor.rkt:1589:0:
generic-get-data

/nix/store/25c7s9jfyyjxms7zxnqxb8ncl812x3kj-racket-6.1.1/share/racket/pkgs/gui-lib/mred/private/wx/common/clipboard.rkt:19:4:
get-data method in pre-client%

/nix/store/25c7s9jfyyjxms7zxnqxb8ncl812x3kj-racket-6.1.1/share/racket/pkgs/gui-lib/mred/private/wx/gtk/clipboard.rkt:154:2:
set-client method in clipboard-driver%

/nix/store/25c7s9jfyyjxms7zxnqxb8ncl812x3kj-racket-6.1.1/share/racket/pkgs/gui-lib/mred/private/wxme/text.rkt:2105:2:
core6772

/nix/store/25c7s9jfyyjxms7zxnqxb8ncl812x3kj-racket-6.1.1/share/racket/pkgs/gui-lib/mred/private/mrmenu.rkt:250:14:
command method in basic-selectable-menu-item%

/nix/store/25c7s9jfyyjxms7zxnqxb8ncl812x3kj-racket-6.1.1/share/racket/pkgs/gui-lib/mred/private/mrpopup.rkt:49:38:
go

/nix/store/25c7s9jfyyjxms7zxnqxb8ncl812x3kj-racket-6.1.1/share/racket/pkgs/gui-lib/mred/private/wx/common/queue.rkt:451:6

/nix/store/25c7s9jfyyjxms7zxnqxb8ncl812x3kj-racket-6.1.1/share/racket/pkgs/gui-lib/mred/private/wx/common/queue.rkt:502:32

/nix/store/25c7s9jfyyjxms7zxnqxb8ncl812x3kj-racket-6.1.1/share/racket/pkgs/gui-lib/mred/private/wx/common/queue.rkt:650:3


On this line

(def gray-grid (color "gray" (grid (pt xmin ymin) (pt xmax ymax) (pt 0 0)
1)))

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] machine states diagrams

2015-01-25 Thread Catonano
2015-01-25 23:18 GMT+01:00 Jens Axel Søgaard :

> 2015-01-25 23:09 GMT+01:00 Catonano :
> > How do I install metapict ?
> >
> > I tried through the package manager with the github repo url, but it
> claims
> > that a MANIFEST file is missing.
>
> In the package manager in DrRacket paste this link:
>
>  https://github.com/soegaard/metapict.git
>
>
Thanks. This is the result

.drracket-wrapped install: invalid package source;
 inferred package name includes disallowed characters
  given: https://github.com/soegaard/metapict.git

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] machine states diagrams

2015-01-25 Thread Catonano
Jens,

2014-12-02 17:03 GMT+01:00 Jens Axel Søgaard :

> Here is an example drawing a simple state machine with MetaPict.
> It shows a little state machine that accepts numbers with
> an even number of zeros in its binary representation.
>
> #lang racket
> (require metapict metapict/structs)
>
>

How do I install metapict ?

I tried through the package manager with the github repo url, but it claims
that a MANIFEST file is missing.

Thanks

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] drawings in SICP

2014-12-05 Thread Catonano
Jens,

thanks for your reply and sorry for the delay in mine.

2014-12-02 13:20 GMT+01:00 Jens Axel Søgaard :

> Is it box and pointer diagrams?
>
> If so, install metapict and let me know how this works:
>
> https://github.com/soegaard/metapict/blob/master/metapict/box-and-pointer-diagram.rkt
>

While they do use box and pointer diagrams in lecture 2a, I was not
referring to them

I was rather referring to the capital A drawn in a rectangle. And then they
introduce some functions that act on such drawings, for example one
function flipped them

Some other functions stretched them or repeated them several times to
create fancy patterns.

I have taken 3 screenshots from the lecture footage for your reference

here:
https://www.dropbox.com/s/8dcht9buge9eovy/screenshot3.png?dl=0
https://www.dropbox.com/s/gab1t09p9b3xj97/Screenshot2.png?dl=0
https://www.dropbox.com/s/kvwo622gv1opem8/screenshot.png?dl=0

Thanks again

  Racket Users list:
  http://lists.racket-lang.org/users


[racket] drawings in SICP

2014-12-02 Thread Catonano
In SICP lecture 2a they demonstrate some drawings.

Are those reproducible with Racket ?

  Racket Users list:
  http://lists.racket-lang.org/users


[racket] machine states diagrams

2014-12-02 Thread Catonano
Someone suggested me that a module for Racket exists that can produce some
very nice diagrams of scheme machine states.

Would anyone point me to that ?

I'm in this SICP study group and I'd love to provide some sensory proofs of
the internal workings of the machine.

Thanks

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] SICP (again)

2014-11-26 Thread Catonano
2014-11-26 13:17 GMT+01:00 Alexander McLin :

> The square function is also defined in earlier SICP sections so I would
> recommend you maintain a running file of all functions SICP defines so you
> can refer back to them easily.
>

Ok, this seems a reasonable approach. Note taken, thanks

Are there any specific advices you'd give in order to follow the SICP on
Racket ?

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] SICP (again)

2014-11-26 Thread Catonano
2014-11-26 12:56 GMT+01:00 Joshua TAYLOR :

> Why not just do:
>
> (define (square x)
>   (* x x))
>
> ?
>
>
I did, and it works.

But my concern is about the incompatibility level between the two platforms.

Going forward in the course, it could get worse, we are somewhat all
beginners, the concepts involved are abstract and adding a further
cognitive overhead layer doesn't seem a good idea.

  Racket Users list:
  http://lists.racket-lang.org/users


[racket] SICP (again)

2014-11-26 Thread Catonano
Hello

I understand that this is not the first time someone asks about using
Racket for a SICP study group.

I used the not so mantained mit-scheme compatibility package and I tried to
paste this piece of code



(define (average x y)
(/ (+ x y) 2))

(define (sqrt x)
(define (improve guess)
(average guess (/ x guess )))
(define (good-enough? guess)
(< (abs (- (square guess) x )) .001))
(define (try guess)

(if (good-enough? guess)
guess
(try (improve guess
(try 1))


It should be the Newton's method to calculate the square root

We copied it from the lectures

In this code we use the "square" function. In mit-scheme it's ok, in Racket
it's not defined

Should I import any module ?

Are common functions named as in mit-scheme ? Or are we gonna run into
compatibility issues ?

Thanks for any hint

  Racket Users list:
  http://lists.racket-lang.org/users