Arc Forumnew | comments | leaders | submit | globalrev's commentslogin
1 point by globalrev 6086 days ago | link | parent | on: Smalltalk vs LISP

everything in python is also an object just like in smalltalk right(or python has primitives?)?

what is the difference(well in this regard, obv they are different) then between smalltalk and python?

-----

5 points by gnaritas 6081 days ago | link

Everything is python is not an object. Python uses procedural control structures like if/else/while/for implemented as special keywords. Smalltalk implements those control structures with objects, the Boolean subclasses True and False which have methods ifTrue:ifFalse: and the class BlockContext which implements methods such as whileTrue: and whileFalse:.

Having objects is entirely different from using objects as the basic building block of every abstraction in the language. Objects in Smalltalk are what S-expressions are to Lisp. Python and Ruby just have objects, but those languages aren't built from objects.

-----

1 point by globalrev 6086 days ago | link | parent | on: Anarki tut: urexample fails

im using vista and anarki.

downloaded anarki like 2 weeks ago and havent fetched a new version since.

-----

1 point by globalrev 6087 days ago | link | parent | on: having a parenthesis in a list?

yes and i dont want to, is there a way to get around this.

(car '(( 1 2)) and have ( returned. u cant do some trick here?

(car'("(" + 1)) returns "(", how do i get rid of the ""?

-----

4 points by kens 6087 days ago | link

If you want to display a string without the quotes, use "disp" instead of "write".

If you want to convert a string into an S-expr, use "read", and then if you want to evaluate that expression, use "eval".

  (eval (read "(cons (cons 1 2) 3)"))
But I'm pretty sure you don't want to do either of those in this case. If what you want is nested lists, generate the nested lists - Lisp is good at that. Don't try to piece together your code out of parentheses. The following code will more-or-less generate the nested lists you asked about:

  (def xw (n)
    (let l '()
      (for x 1 n
        (= l (join 'w/link (list l))))
      l))
However, the other problem with your approach is that even if you get xv working, it will pass a quoted expression to defop instead of an expression, and defop won't work right. To generate code, you need a macro, not a function. Here's a macro that will solve your original problem:

  (mac xw args
    (if (is (len args) 1)
          `(pr ,@args)
          `(w/link (xw ,@(cdr args)) (pr ,(car args)))))

  (defop wc req (xw "Wel" "come" "to" "Sweden" "!"))

-----

2 points by conanite 6087 days ago | link

are you looking for something like

  (prn (list #\( 'foo #\)))

?

-----

1 point by globalrev 6088 days ago | link | parent | on: Anarki tut: urexample fails

should i even get the loginform?

-----

1 point by globalrev 6088 days ago | link | parent | on: MySQL needed?

where is the news.y sourcecode? couldnt find it googling and not on the arc or anarki homepages.

-----

2 points by lojic 6088 days ago | link

It's in the tarball as news.arc

-----


yes ty very much.

the break though:

arc> (= app (thread (asv))) #<thread> arc> ready to serve port 8080 (break-thread app) . #<void> . ac.scm::34123: user break

-----

2 points by almkglor 6092 days ago | link

A better way is simply this:

  (thread (asv))
    (... work ...)
  (assert quitsrv*)
Then make one last request to the server (it won't terminate until that last one request, because it's stuck listening on the port. yeah, buggy)

For more info on Arc, see kens' excellent guides on http://arcfn.com http://arcfn.com/doc/index.html

-----

1 point by globalrev 6093 days ago | link | parent | on: Big bug in anarki

it is now working

solution by almkglor:

Try editing as.scm in notepad (open notepad and drag it into it). Then find the following line and add a ";" before it: (load "ffi.scm")

-----

2 points by almkglor 6092 days ago | link

you'll have to wait for sacado to respond regarding this bit - I believe he's the one who added FFI to Anarki. It's highly possible that the FFI is just not compatible with Windows, and/or the FFI layer in mzscheme is subtly different between Linux and Windows.

-----

1 point by sacado 6091 days ago | link

Yes, I didn't develop windows compatibility for the FFI. I don't have a windows machine to work with. Sorry if it breaks things under windows ... :(

I hope somebody will eventually come with a patch for this. Until then, almkglor's solution seems to work..;

-----


ive tried all, as.scm, arc-exe-scm.

apparently i should use as.scm(?) but i get an error.

-----

1 point by globalrev 6094 days ago | link | parent | on: Anarki worked 1 time, but not anymore

noone? i can run normal Arc.

-----

1 point by almkglor 6094 days ago | link

are you running Arc by running as.scm?

What, exactly, are the steps (double-click that file, drag that file, etc.) you made to run it?

-----

1 point by globalrev 6093 days ago | link

normal Arc im running by running as.scm yes.

Anarki i run by arc-exe.scm

have tried as.scm too though.

i have tried both doubleclick-starting them and openeing DrScheme then open arc-exe then running it.

normal Arc works both ways.

this is really annoying becuse i justw anna get going with WebApps and it doesnt work ont he normal Arc-version on Windows.

-----

1 point by almkglor 6093 days ago | link

arc-exe.scm is supposed to be compiled, not run directly. Are you sure you ran the Anarki version by double clicking as.scm, and as.scm, only?

Try doing this: Start Menu | Run Program

Then type "cmd" and press enter. This brings up a terminal.

Then find your path. First go to the drive you installed it. For example if it's in drive C, type "C:" and then enter. Then find your path. Go to your windows explorer and explore from there to where you kept Anarki (have to use Windows Explorer specifically, because it's just better than the default view), then select the address bar and press ctrl+c to copy it. Then go back to the terminal, type "cd " (include the space, but don't press enter yet), then rightclick the terminal's title bar and select Edit | Paste, which should paste the path to your terminal, and press enter.

(my knowledge of Windows is starting to embarass me)

Then try the following command:

  mzscheme -m -f as.scm
If commandline doesn't work for you, I'll try to replicate the problem on my XP box, which I, like, don't use except for playing Starcraft and DotA, because I can't get Wine to run in fullscreen properly without scrolling into Gnome.

-----

1 point by globalrev 6093 days ago | link

mzscheme -m -f as.scm 'mzscheme' is not recognized...

this is what i get when trying to run as.scm in DrScheme:

procedure application: expected procedure, given: #f; arguments were: #<struct:fun-syntax> #<syntax:C:\Users\saftarn\Desktop\myanarki\nex3-arc-20af2f3fe921faeca2048d1d932abcdae2a916b4\ffi.scm:18:14>

i tried running as.scm from the DOS-window and it generated the same problem.

the file loads up in DrScheme. then i click Run to start Arc right?

this again: procedure application: expected procedure, given: #f; arguments were: #<struct:fun-syntax> #<syntax:C:\Users\saftarn\Desktop\myanarki\nex3-arc-20af2f3fe921faeca2048d1d932abcdae2a916b4\ffi.scm:18:14>

weirdest thing is it actually worked the first time i ran anarki. i dont remember exactly what i did, is it possible that the first execution could have changed something? or i happened to change some code?

what is the GIT really doing? is it just for downloading new versions? not something i actually will use when programming?

-----

1 point by almkglor 6093 days ago | link

Good, we're getting somewhere. Try editing as.scm in notepad (open notepad and drag it into it). Then find the following line and add a ";" before it:

  (load "ffi.scm")
Then try running it again.

Don't know why FFI isn't working on you, since the line being referenced doesn't actually get used in normal Anarki.

> what is the GIT really doing? is it just for downloading new versions?

Yes, although that's in your case currently.

> not something i actually will use when programming?

Depends. It's what's called a "revision control software". It's like CVS or Subversion (you might have used those). It lets you keep track of changes in your software, and lets you manage the development. For example, you can automatically create versions of software, which you can revert (for example, if a bug is reported by a user in the latest version, you can get a copies of succeedingly older versions until you see the bug disappear. Then you can get the difference between the version-without-bug and the first version-with-bug and see what exactly you changed that could be causing the problem). Up to you to use while programming. Any revision control software is good; git is considered one of the better ones.

-----

1 point by globalrev 6093 days ago | link

ty very very much it is finally working.

-----

2 points by globalrev 6094 days ago | link | parent | on: git, anarki, windows and ark.help!

booyakasha!

now the webapp is working. ty anarki-developers.

-----

More