Arc Forumnew | comments | leaders | submitlogin
2 points by ChristophRe 3385 days ago | link | parent

I wanted create a frame with in Racket

; Make a frame by instantiating the frame% class (define frame (new frame% [label "Example"]))

but because of Arc special syntax like [+ _ 1] this does not work, because the interpreter translage [label "example"] into a anonymous function.

Anyone who know how to solve this?



2 points by Pauan 3385 days ago | link

I just fixed a bug in Arc/Nu, so now you can do this:

  (%:require racket/class)
  (%:require racket/gui/base)

  (= frame (%:new frame% (label "Example")))
Notice that you can use () rather than [], because in Racket the syntax reader converts [] into ().

You need to require "racket/class" because Arc/Nu only requires "racket/base", rather than all of "racket".

-----

2 points by ChristophRe 3385 days ago | link

in the end it would be nicer to have an Arc library that wraps the underlying gui racket library in the spirit of Arc. Arc is much simpler than scheme code. I does not like complicated syntax. I also does not like OO and classes of racket. It is the wrong way. Hashtable like in Javascript and writing your own OO-like library is much more flexible.

-----

1 point by akkartik 3384 days ago | link

You should build it :) Doesn't have to be complete at the start, just use it for a certain program and try to think of a cleaner way to express what you build. Then come ask us for help.

-----

2 points by ChristophRe 3385 days ago | link

Thank you very much. I assume that I could use another syntax for [...] like in Arc. But I did not find it. So often it is better to ask people you has better scheme background. I am not grown up with Lisp stuff.

-----