Re: [Wrapl-discussion] How to invoke such method :"@"?
Brought to you by:
rajamukherji
|
From: Roman M. <rom...@gm...> - 2010-05-30 09:37:26
|
> > >> VAR text <- mylist@String.T; > Indeed. I have already used @ to convert an integer to a string in MOD Bottles. I think I didn't get the very thing that the type itself is used as an argument. You can also use > > mylist@(String.T, " ") > I come up with such line: Out:write(verse[2,0]@(String.T, "") + verse[1]); I tried it on a Linux machine with the latest Wrapl version and it works. but I'm not very happy with this syntax and am still open to suggestions > about changing it. > Perhaps being not so intuitive at first sight, it seems OK to me. Knowing that this syntax comes from a general rule of how to call a method, it seems acceptable. The first thought on how to change it is to use something similar to: mylist @ String.T VIA " "; analogous to :"[]=", and possibly using some special character :"@~" (mylist @ String.T ~ " ";). This is from my perspective, however. By the way, you're the first person to seriously try using Wrapl, so the > online documentation may be a bit lacking in places. I'll try to improve it > based on your comments. > > Also, the Windows port of Wrapl is a bit out of date, I don't think any of > the versions of @ with 3 or more arguments are implemented in it. Since your > last comment, I have mostly fixed the Windows port and will put the new > version on the website within the next week. > Thank you. Most of the time I work on Windows. Recently, though, I set up a Linux machine to experiment with. If you are interested, here is a little bit of my experience with Wrapl installation on Linux: -- I set up a fresh Debian-compatible distro - Linux Mint - on VirtualBox. Then I installed both wrapl-1.7.1041.deb and wredit-1.7.1041.deb. Some dependencies were installed by package manager. The whole installation went without an issue. In the shell I got this: roman$ wrapl Error: /usr/lib/libtermcap.so: undefined symbol: setupterm Error: symbol setupterm not exported from libtermcap Error relocating [82d7808] /usr/lib/riva/Util/Tecla.riva:93 As I found out this relates to the Wrapl interpreter only, not to riva. "Hello World" scripts were working. I searched for "termcap Debian" and found this page http://archive.debian.net/bo/admin/termcap-compat which explains incompatibility between termcap and current Debian versions. So I installed the package mentioned on the page. Yet, it didn't help. The error remained. The page also mentions libncurses, so in search for a solution the next thing I did is installed libncurses5-dev package, since libncurses5 was already in place. And this did help. Wrapl started right away. With not much experience, I think the only missing dependency is some library in libncurses5-dev package. -- Going further, I want to ask how to read this descriptions in Libraries:Agg:List: :"="(_ @ T, _ @ T, _ @ Agg.ObjectTable.T) Does it compare two lists? [1, 2] = [1, 2]; I am getting "failure". What is third argument? Does underscore have special meaning in descriptions or it just denotes "something"? :"@"(_ @ T, _ = Std.String.T) this seems similar to: :"@"(list @ T, _ = Std.String.T, sep @ Std.String.T) : Std.String.T but without separator and it does not define return type. It works: --> VAR s <- mylist@String.T; [one, two, three] --> ? s; C:\Wrapl\lib\Std\String.T But I honestly wonder, is this practical after a conversion to have a string formatted as list? -- Roman |