17:53:32 | * | NimBot joined #nimrod |
17:54:26 | dom96 | apriori__: c2nim converts it to this: proc strtod*(nptr: cstring; endptr: cstringArray): cdouble |
17:54:41 | apriori__ | O_o..ok |
17:55:13 | dom96 | I think cstringArray is just ptr cstring though |
17:55:28 | dom96 | and the ; can just be , anyway |
17:56:33 | apriori__ | well |
17:56:37 | apriori__ | doesn't like that either |
17:56:53 | dom96 | oh er. |
17:56:56 | apriori__ | gcc -c -w -I/usr/lib/nimrod -o /home/armin/nimcache/bla.o /home/armin/nimcache/bla.c |
17:56:57 | dom96 | You need to specify the header. |
17:56:57 | apriori__ | /home/armin/nimcache/bla.c:160:1: error: conflicting types for ‘strtod’ |
17:56:59 | apriori__ | In file included from /usr/lib/nimrod/nimbase.h:251:0, |
17:57:00 | apriori__ | from /home/armin/nimcache/bla.c:8: |
17:57:02 | apriori__ | /usr/include/stdlib.h:164:15: note: previous declaration of ‘strtod’ was here |
17:57:17 | dom96 | hrm. |
17:59:37 | apriori__ | dom96: interesting |
17:59:40 | apriori__ | working.. |
17:59:43 | apriori__ | but I don't really get, why |
17:59:52 | apriori__ | and why "header" was needed, at all |
17:59:56 | apriori__ | because I never needed it |
18:00:13 | dom96 | I have no idea either heh |
18:04:16 | * | Araq_bnc quit (*.net *.split) |
18:10:13 | * | Araq_bnc joined #nimrod |
18:10:22 | * | XAMPP_ joined #nimrod |
18:13:28 | * | XAMPP quit (Ping timeout: 246 seconds) |
18:16:54 | * | apriori__ quit (Quit: Konversation terminated!) |
18:31:57 | * | Araq_bnc is now known as Araq |
18:41:33 | dom96 | Araq: Why is header required? |
18:41:43 | Araq | for what? |
18:41:57 | dom96 | Read scrollback. |
18:41:59 | dom96 | Oh wait. |
18:42:17 | Araq | 17:54:26 dom96 apriori__: c2nim converts it to this: proc strtod*(nptr: cstring; endptr: cstringArray): cdouble |
18:43:11 | Araq | it's not really required ... 'nodecl' is required |
18:43:17 | dom96 | ahh |
18:43:20 | Araq | it's just that header implies 'nodecl' ... |
18:43:24 | dom96 | mm |
18:43:36 | dom96 | brb |
20:25:14 | * | XAMPP_ quit (Quit: Leaving) |
20:25:53 | * | XAMPP joined #nimrod |
20:37:12 | dom96 | back |
21:43:19 | shevy | wheee |
21:43:33 | Araq | hi shevy |
21:44:33 | shevy | oh whoever runs http://forum.nimrod-code.org/ |
21:44:48 | shevy | could add a link to dom96's site |
21:44:51 | shevy | where was it again? :) |
21:45:09 | shevy | http://dom96.co.cc/nimbuild/ |
21:45:10 | shevy | hmm |
21:45:21 | shevy | had the link stored in a local page |
21:45:30 | shevy | I am trying to find examples for those Type * things |
21:45:39 | Araq | http://build.nimrod-code.org/ also exists |
21:46:19 | Araq | shevy: do you know what a grammar is? |
21:46:27 | shevy | oh nice... when you search for "nimrod type system"... you get links to forum where people wrote about nimrod: http://www.dreamincode.net/forums/topic/209048-nimrod-the-compiled-garbage-collected-systems-programming-language/ |
21:46:39 | shevy | Araq, hmm not sure... rules to "build" a language? its logical parts or context perhaps? |
21:47:04 | Araq | alright well my explanation about types won't help you then ;-) |
21:47:09 | shevy | hehe |
21:47:15 | shevy | oh don't worry too much |
21:47:25 | shevy | I like to look at example code, and slowly get my head into trying to understand what it does |
21:47:35 | shevy | var tcp : TSocket |
21:47:46 | shevy | tcp is a variable I suppose |
21:47:52 | Araq | I'm puzzled why this is so difficult for you |
21:47:53 | shevy | what is TSocket precisely? |
21:48:02 | shevy | I never really used types in such a way before |
21:48:09 | dom96 | shevy: Have you looked at my Ruby to Nimrod comparison gist? |
21:48:11 | Araq | it's a type that means: "tcp is a socket" |
21:48:15 | shevy | in ruby, you only have to do things like object.to_a (to convert it into an Array) for instance |
21:48:26 | Araq | in ruby there are types as well |
21:48:30 | shevy | dom96, where was that gist? sorry ... might be I fell asleep *blush* |
21:48:33 | Araq | it's just that you cannot write them down |
21:48:40 | shevy | hmm ok |
21:48:58 | dom96 | https://gist.github.com/3263560 |
21:48:59 | shevy | can I say then... "The variable tcp is of type TSocket." that would be correct? |
21:49:12 | dom96 | Please be aware, that code does not compile |
21:49:17 | shevy | aha |
21:49:27 | shevy | ok... the procs are like defs |
21:49:35 | dom96 | I just wrote it as a way to perhaps make you understand |
21:49:56 | shevy | well ok |
21:49:57 | Araq | shevy: yes you can say that |
21:50:02 | shevy | name and age... similar to @name and @age |
21:50:04 | * | Boscop quit (Disconnected by services) |
21:50:07 | * | Boscop joined #nimrod |
21:50:10 | shevy | and string and int I suppose say that these are their types |
21:50:13 | shevy | but what is the * there again? |
21:50:19 | shevy | age*: int |
21:50:21 | Araq | export marker |
21:50:36 | Araq | has nothing to do with the type |
21:50:54 | shevy | aha ok |
21:50:59 | shevy | next newbie question |
21:51:03 | shevy | name will always be a string right? |
21:51:13 | Araq | yes |
21:51:18 | shevy | ok :) |
21:51:46 | shevy | oh dom96 ... the part: |
21:51:48 | shevy | result.name = name |
21:51:51 | shevy | where from is result ? |
21:52:01 | shevy | I take it that name and age are arguments to newPerson |
21:52:07 | shevy | but I am unsure where result. is from ... |
21:52:20 | dom96 | Every proc that returns something has a magic 'result' variable defined |
21:52:23 | dom96 | So that you don't need to |
21:53:38 | Araq | 'result' represents the return value |
21:53:46 | Araq | proc p(): int = |
21:53:47 | shevy | ah ok |
21:53:51 | Araq | result = 13 |
21:53:56 | Araq | returns 13 |
21:54:17 | shevy | would that conflict somehow? |
21:54:18 | shevy | for instance |
21:54:24 | Araq | good nimrod style is to avoid the 'return' keyword ;-) |
21:54:26 | shevy | TPerson = object |
21:54:36 | shevy | result*: int |
21:54:42 | shevy | would that be possible ^^^ ? |
21:54:49 | shevy | hehe |
21:54:49 | Araq | yes |
21:55:04 | shevy | in ruby, you can omit the "return" keyword too. the last expression is automatically what is returned |
21:55:07 | shevy | but I like it, visually |
21:55:09 | shevy | def foo |
21:55:10 | shevy | return 5 |
21:55:12 | shevy | hmm |
21:55:14 | shevy | def foo |
21:55:15 | shevy | 5 |
21:55:19 | shevy | is shorter though, so I have mixed feelings |
21:55:25 | shevy | ok Araq |
21:55:37 | Araq | I like that the last expression is automatically returned in ruby |
21:55:48 | shevy | ok one question: |
21:55:49 | Araq | unfortunately nimrod does not work that way (yet...) |
21:55:49 | shevy | return person.name & " " & person.age |
21:55:55 | shevy | I take it & is string concatenation |
21:56:05 | shevy | and name is a string... but .age should be an int right? |
21:56:13 | Araq | right |
21:56:16 | shevy | how does nimrod know that this concatenation should work? |
21:56:26 | Araq | it doesn't work ;-) |
21:56:32 | shevy | dom96!!! |
21:56:38 | Araq | you need to convert the int to a string with $ |
21:56:40 | shevy | teach me bad things! |
21:56:42 | shevy | ah ok |
21:56:44 | dom96 | yes? |
21:56:52 | shevy | oh |
21:56:59 | dom96 | oh, yeah. |
21:57:02 | dom96 | My mistake sorry |
21:57:03 | Araq | it could easily work though: |
21:57:19 | Araq | proc `&` (x: string, y: int) = result = x & $y |
21:57:29 | shevy | hmm |
21:57:31 | Araq | and then it would work |
21:57:34 | shevy | ok |
21:57:53 | Araq | it's a feature nimrod doesn't have that in its stdlib though ;-) |
21:59:28 | dom96 | Araq: Is the column for --def 0 or 1-based? |
22:00:05 | Araq | the same as what aporia does |
22:00:22 | dom96 | er. Well line was wrong already :P |
22:00:35 | dom96 | well maybe not |
22:00:38 | dom96 | but I had to subtract 1 |
22:00:51 | dom96 | So i'm guessing it's the same for col |
22:02:05 | Araq | why subtract 1? |
22:02:11 | Araq | I didn't have to do that ... |
22:02:58 | dom96 | i dunno |
22:03:06 | dom96 | If I don't it's 1 too far |
22:09:37 | * | XAMPP_ joined #nimrod |
22:10:36 | Araq | well it starts with line 1 ... |
22:10:44 | * | XAMPP_ quit (Read error: Connection reset by peer) |
22:12:29 | * | XAMPP_ joined #nimrod |
22:12:31 | * | XAMPP quit (Ping timeout: 246 seconds) |
22:12:59 | dom96 | Araq: There you go. |
22:13:11 | Araq | yummy |
22:13:11 | dom96 | But just FYI scrolling fails when it opens a new file... |
22:13:19 | Araq | why? |
22:13:21 | dom96 | Because GTK is being a bitch as always with scrolling |
22:13:24 | Araq | I thought you fixed that |
22:13:39 | dom96 | Well it decides to fail again on Go to definition |
22:14:43 | dom96 | I bet your first question will be: "How do I use this?" |
22:14:43 | dom96 | :P |
22:14:49 | dom96 | Right click in the editor ;) |
22:16:24 | Araq | lol |
22:16:29 | Araq | it doesn't work :P |
22:16:41 | Araq | but I know why ;-) |
22:16:59 | dom96 | oh? |
22:17:38 | Araq | well I'm testing it in an include file |
22:17:56 | Araq | so the compiler jumps to the first occurance of the symbol, not its definition |
22:18:30 | Araq | yay |
22:18:33 | Araq | it works |
22:18:41 | Araq | except for the scrolling part of course |
22:18:59 | Araq | now that should be useful |
22:19:05 | dom96 | The scrolling works if the file is already opened |
22:20:30 | Araq | hm |
22:20:32 | Araq | bug! :P |
22:20:40 | Araq | it doesn't list the file as recently opened |
22:20:47 | Araq | when it opened the file for --def |
22:21:01 | dom96 | oh god. Come on :P |
22:21:19 | Araq | it's a bug, don't deny it |
22:29:34 | dom96 | I could argue it's not. |
22:29:50 | dom96 | :P |
22:29:53 | dom96 | I should sleep anyway. |
22:29:54 | dom96 | bye |
22:30:23 | Araq | good night |
23:01:19 | * | XAMPP_ quit (Quit: Leaving) |
23:05:41 | * | Trix[a]r_za is now known as Trixar_za |
23:46:37 | Araq | good night |
23:47:04 | Trixar_za | Goodnite Araq |
23:50:44 | * | XAMPP joined #nimrod |