<Drakken>
What's the status of generic printing these days? Are there any plans to add it in the near future?
<Qrntzz>
Kakadu: pong
ocp has quit [Ping timeout: 244 seconds]
pilki has quit [Ping timeout: 240 seconds]
metasyntax|work has quit [Quit: WeeChat [quit]]
sepp2k has joined #ocaml
ankit9 has quit [Quit: Leaving]
<hcarty>
Drakken: Batteries has a large number of composable printing functions, and oleg wrote something similar using first-class modules.
<hcarty>
Drakken: Beyond that, (lots of?) camlp4 extensions or compiler changes are required.
samposm_ is now known as samposm
<Drakken>
hcarty thx
<Kakadu>
Qrntzz: any news?
ftrvxmtrx has quit [Quit: Leaving]
letrec has joined #ocaml
letrec has quit [Remote host closed the connection]
<Qrntzz>
Kakadu: figured out how to implement new event behavior, trying to fix/test code in inher/ and simple_signals/, mostly different include path problems
<f[x]>
Qrntzz, yep, the build system there was a mess from very beginning
<Qrntzz>
I'll attempt to fix it once I actually manage to compile everything apart
letrec has joined #ocaml
<orbitz>
f[x]: thank you
ocp has joined #ocaml
<Qrntzz>
Kakadu: still not sure I fully understand what's happening with abstract classes and inheritance
<Qrntzz>
e. g.
<Qrntzz>
is_abstract_class of QSpinBox says false
<Qrntzz>
is_abstract_class of QPushButton says false
<Qrntzz>
is_abstract_class of QAbstractSpinBox says false
<Qrntzz>
is_abstract_class of QAbstractButton says true
<Kakadu>
what line is suspicious?
<Qrntzz>
why the abstract button class _is_ in fact abstract, while the abstract spinbox one isn't? I'm actually having problems with the former, as simple_signals/ won't work without QPushButton, which needs QAbstractButton afaicu
<Qrntzz>
I followed the same sequence as when I added QCloseEvent handling to the test app, but it turns out abstract classes (and/or classes inheriting from them) are trickier than that. also see http://paste.in.ua/3580/
<Qrntzz>
bbiab, need to wander outside.
<Kakadu>
fuck, why this IRC client doesnt report about new messages?!?
<Kakadu>
about yours paste. Have you fixed sh file?
<Kakadu>
if yes have you added QPaintEvent to this sh file?
sepp2k has quit [Remote host closed the connection]
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 268 seconds]
raichoo has quit [Ping timeout: 260 seconds]
iago has joined #ocaml
<thelema>
does anyone know the easy/right way to make a release from a darcs repo?
<thelema>
OCaml needs some explanation like this haskell packaging page
<adrien>
thelema: browsers have a search feature ;p
probst has quit [Quit: probst]
probst has joined #ocaml
oriba has joined #ocaml
<Qrntzz>
Kakadu: I'm back and I just did, it compiles fine now
<Qrntzz>
Kakadu: the simple_signals demo is supposed to render a clickable button, right?
ocp has quit [Ping timeout: 240 seconds]
ulfdoz_ has joined #ocaml
cago has left #ocaml []
ulfdoz has quit [Read error: Operation timed out]
ulfdoz_ is now known as ulfdoz
<thelema>
E: Field tests is not defined in schema environment
<thelema>
WTF? oasis is too magical
<adrien>
oasis needs longer error messages
* thelema
gives up on odn for the moment and will have to pester gildor about it
<thelema>
adrien: the error messages make sense for gildor, I'm sure.
<Kakadu>
Qrntzz: yep
<adrien>
probably
<adrien>
unless he has not seen it in one year =)
<thelema>
And the eror is sort of clear - there's some lines in odn's _oasis file with "flag(tests)"
<thelema>
it's setting some sort of flag, but apparently something is missing in my oasis executable, and it generates broken code for those lines.
<thelema>
maybe I'll just cut those lines from the odn _oasis
<adrien>
besides gildor, is there anyone with commit rights to oasis on the channel?
<thelema>
I just got them yesterday.
<thelema>
I think. I haven't tried to even check it out yet
<adrien>
is it fine if I send you patches to improve doc/sentences/strings?
<thelema>
grr, more darcs
<thelema>
I'll only be able to apply them once I figure out darcs
<adrien>
hahah, yeah; I'll have to find a format I'm able to create and that can be easily applied
<thelema>
but in general, yes.
<thelema>
:)
<thelema>
yes, please help improve oasis
<thelema>
hmm, I may have access to oasis-db too, meaning I can enable test dependencies in odb
<thelema>
LOL, darcs is giving me a 5-line emoticon frown
<thelema>
something about old-fashioned repo format
<Qrntzz>
Kakadu: blah, it doesn't. but it seems to think it does.
<Kakadu>
I didn;'t touch this example many days
<Kakadu>
maybe after invloving abstract classes something have failed
<Kakadu>
let's discuss some other aspects
<Qrntzz>
sure.
<Kakadu>
have you understand how overrided (in OCaml) methods are called from C++?
mdelaney has joined #ocaml
<Qrntzz>
Kakadu: not quite yet
<Qrntzz>
from what I can figure out, the ocaml runtime returns a twin class instance to the C++ one, with the method differing from the original (non-`twin') implementation
<Kakadu>
yep
raichoo has joined #ocaml
<Kakadu>
короче
<Kakadu>
С++ный класс знает про камлёвый класс
<Qrntzz>
ну, это понятно
<Kakadu>
С++ умеет вызывать камлёвые методы
<Kakadu>
положим qt вызывает keyPressEvent у QWidget
<Kakadu>
два варианта ---- метод был переопределен или не был. так?
<Qrntzz>
угу.
<Kakadu>
да, мы помним что на самом деле QWidget это QWidget_twin
<Kakadu>
и он умеет дергать методы суперкласса
<Kakadu>
короче когда метод переопределен, С++
letrec has quit [Ping timeout: 276 seconds]
<Kakadu>
1. дергает метод камлёвого класса
<Kakadu>
2. вызывается камлёвая реализация.
<Kakadu>
профит. так?
<adrien>
I think I've spotted an error in Set.add: when adding an element that is already in the set, it should not replace it
<Qrntzz>
ну так. я примерно так это себе и представлял. :-)
<adrien>
my type t = { id : int; foo : float } and let compare t1 t2 = compare t1.id t2.id
<Kakadu>
Qrntzz: если метод не переопределен, то вызвает из камля этот метод, только как функция супер-класса
<Kakadu>
вот и всё.
<adrien>
and that way I can update the element but I'm wondering if the documentation should be changed or if it is the behaviour
<_habnabit>
adrien, if the items are equal, it shouldn't matter which is in the set
<_habnabit>
adrien, that's what equality is for
<thelema>
adrien: you're right that Set.add should return the old set if the element is already in the set
<Kakadu>
Qrntzz: next, we should discuss what methods are available in C++ and not available in OCaml
<Kakadu>
afk for a few minutes
<Qrntzz>
Kakadu: okay, understood.
sepp2k has joined #ocaml
<adrien>
I could have a Map too but having a map from int to the whole record (which also contains the int) feels a bit useless when Set works well
<adrien>
I think I'll keep Set for now and open a bug report (or check there isn't one already)
<_habnabit>
Map.add does the same thing
<thelema>
adrien: It would require a bit of special handling to not replace the existing element
<thelema>
If x was already in s, s is returned unchanged.
probst has quit [Quit: probst]
<thelema>
but it is documented to have the behavior you expected
<thelema>
adrien: this is batSet or stdlib Set?
<adrien>
thelema: stdlib Set
<thelema>
adrien: very surprising...
<adrien>
tbh I'm also curious abou the reason to _not_ replace the element: I can't see a drawback
<thelema>
ease of implementation
<thelema>
you'd have to check physical equality at each level going up to not replace the subtrees
<thelema>
or use an exception to escape the recursion
<thelema>
the subtree rooted at your element is going to be unchanged...
<thelema>
but all its ancestor nodes will be re-created
<thelema>
but this isn't what you're describing...
<thelema>
Are you *sure*?
<thelema>
stdlib set looks like it doesn't replace.
<adrien>
arf
<adrien>
I had started reading the implementation and couldn't understand how it could replace
<adrien>
triple-checked my code and I had indeed made a mistake
raichoo has quit [Ping timeout: 248 seconds]
<adrien>
time to go out, eat, drink, sleep, bye =)
<thelema>
cheers
raichoo has joined #ocaml
Cyanure has quit [Quit: Quitte]
<Kakadu>
Qrntzz: I'm here
<Kakadu>
Qrntzz: Let's discuss what method can be called from OCaml and what not
<Qrntzz>
( Kakadu) Qrntzz: next, we should discuss what methods are available in C++ and not available in OCaml
<Qrntzz>
yes
<Kakadu>
void show(); of couse is good methods
<Kakadu>
method*
<Kakadu>
void setParent(QObject*) ?
<Qrntzz>
hm
<Qrntzz>
is it currently not available?
<Kakadu>
vailable
<Kakadu>
available
<Qrntzz>
why the question mark, then
<Kakadu>
It has a class in an argument
<Kakadu>
a pointer to object
<Kakadu>
OCaml signature is setParent: qObject -> unit
<Kakadu>
where qObject is a class
<Kakadu>
OCaml class
<Qrntzz>
so, it actually is a qObject, not a polymorphic variant of it
<Qrntzz>
understood
<Kakadu>
We should should receive a pointer to C++ object from see and wrap it with OCaml class and give as first argument to OCaml methods
<Kakadu>
we construct ocaml class in C++ in lablqt now.
<Qrntzz>
mhm
<Kakadu>
C++ should know about OCaml constructors
<Kakadu>
maybe this aspect is not good
<Kakadu>
we can send C++ pointer to ocaml function which returns an ocaml class but this is not just implemented
<Kakadu>
may it will be better for lablqt
<Qrntzz>
I guess
* Qrntzz
thinks we should leave refactoring for a bit later when everything actually works as is
<Kakadu>
thats why QAbstractButton is not an virtual class in OCaml. We access constructors directly from C++
<Qrntzz>
ah
<Kakadu>
but we can write a function which return ocaml `unclassed` object same as ocaml's qAbstractButton
<Kakadu>
unclasses is like that
<Kakadu>
unclassed*
<Kakadu>
let f x = object method foo = x end
<Qrntzz>
unclassed as in, on-the-fly generated object?
<Qrntzz>
ah, yes
<Qrntzz>
what I meant
metasyntax|work has joined #ocaml
<Kakadu>
and it is not implemented again)
<Qrntzz>
heh
<Kakadu>
я начинаю бояться что ты поймешь что это убей себя ап стену и забьешь на мою поделку.
<Kakadu>
Тебе пока не страшно?)
<Qrntzz>
гг, я уже немного начал, но выхода у меня нет, кроме как (брат посоветовал) забить на камл и написать нативно-красиво на плюсах. но либу хочется допилить хоть немного
<Qrntzz>
все равно альтернатив для qt4 нету.
<Kakadu>
угу
<Kakadu>
moving on
<Qrntzz>
indeed
<Kakadu>
Lets talk about abstract classes. When a class is abstract in C++?
<Kakadu>
when it has pure virtual methods
<Qrntzz>
when it has pure methods (?)
<Qrntzz>
yes
<Kakadu>
and.... when we can instantiate it)
<Kakadu>
It is not very correct in terms of C++
<Kakadu>
but it is very close to lablqt's classes
<Qrntzz>
instantiate or inherit from it? doubt you can instantiate an abstract class as-is, without defining methods
<Kakadu>
I cant instantiate when I cant call any of its constructors
<Qrntzz>
right
<Kakadu>
but what should I do if class has only one constructor:
<Kakadu>
A(const QModelIndex&) ?
<Qrntzz>
hrm
<hcarty>
adrien: The compare function for the set elements may not compare every component of a value in a set. In that case, it would matter if the existing element is replaced in the returned set.
<Qrntzz>
not sure I understood
<Qrntzz>
why not use the only constructor?
<Kakadu>
in C++ of couse
<Kakadu>
but how to send a value allocated in a stack to OCaml?
<Kakadu>
I have no idea
<Kakadu>
and it is not implemented)
<Kakadu>
and thess class should be virtual in OCaml
<Qrntzz>
tbh, no clue myself (yet)
<Kakadu>
now look how we create twin classes
<Kakadu>
we override all methods and call OCaml methods from overrided C++ methods
<Kakadu>
I have some problems with formulating
<Kakadu>
короче говоря
<Kakadu>
когда делаем twin класс мы переопределяем все методы и говорим им вызывать камло
<Qrntzz>
угу
<Kakadu>
а если один из методов типа void foo(QModelIndex&) ?
<Kakadu>
я хз как его переопределять
<Kakadu>
вернее хз как аргумент передавать в камло
<Kakadu>
я всегда надеялся что переопределив методы в twin классе и реализовав абстрактные методы будет всё ОК
<Kakadu>
но вот я наткнулся на класс
<Kakadu>
где абстрактный метод того вида, который выше указан
<Kakadu>
иииии мне стало плохо
<Kakadu>
я не могу сделать из него твин класс
<Kakadu>
если сделаю, этот метод не будет виден в камле
<Qrntzz>
ааа.
<Kakadu>
и хз как реализовывать в twin класса void foo(QModelIndex&)=0
<Kakadu>
классе*
<Kakadu>
и сейчас компиляция валится с ошибкой что твин класс абстрактный и не могу вызывать конструктор
<Kakadu>
следовательно я не могу делать такие твин-классы
<Kakadu>
следовательно я не могу разрешить в камле наследование от таких классоы
<Kakadu>
классов*
<bobry>
oh my, russian in #ocaml
<orbitz>
Ocaml - The Language of Discriminating Communists since 1996
<zorun>
oh noes, a third russian guy :))
<bobry>
:D
<bobry>
orbitz: are you also russian?
<Qrntzz>
понятно. т. е. если это все работает так, как сейчас, то на идентичность классов C++/qt и камла не приходится из-за методов, которые невозможно наследовать
<Qrntzz>
печально
<Kakadu>
я в шоке
<Kakadu>
я бы мог захакаться методы типа void foo(QSize&)
<Kakadu>
захакать*
<Kakadu>
но void foo(QModelIndex&)=0 ....
<Kakadu>
TT
<Qrntzz>
как-то допилить это можно или для того, чтобы все было нормально, нужно просто другую архитектуру придумывать?
<Kakadu>
bobry: he is talking about f[x]
<orbitz>
I love f[x]
Kakadu has quit [Read error: Connection reset by peer]
raichoo has quit [Ping timeout: 240 seconds]
Kakadu has joined #ocaml
<Kakadu>
Qrntzz: мы можем не генерить плохие камлёвые классы
<Qrntzz>
гг
<Kakadu>
мы можем запретить использовать методы где есть такие плохие аьстрактные классы в параметрах
<Qrntzz>
но это будет неполноценный биндинг, не?
<Kakadu>
Если он будет работать, то в нем много вещей можно будет сделать
raichoo has joined #ocaml
<Kakadu>
ты можешь предложить что-то
<Kakadu>
например можем сформулировать проблему в вики и натравить адриана
<Kakadu>
флакса
<Qrntzz>
у меня всегда от ООП мозги портились, но я подумаю
<Qrntzz>
адриана, кстати, хорошая мысль
<Qrntzz>
он же гтк как-то пилил.
<Kakadu>
ты можешь придумать свой способ "наследоваться"
<Kakadu>
или мы можем положить на QtGui и научиться хорошо сшивать qml и камло
<Qrntzz>
я бы был доволен и одним qml, например
<Kakadu>
ну мы могли бы юзать камло там где qmlщики юзают плюсы
<Kakadu>
Qrntzz: предлагаю написать Цивилизацию на qml )
<Qrntzz>
в текущей версии lablqt ведь все равно, даже если взлетит, придется интерфейс руками запихивать
<Qrntzz>
ибо дизайнер выкладки генерит только на плюсах.
<Qrntzz>
гг, неплохая идея
<Kakadu>
можно будет написать uic который генерит камлёвый код
<Qrntzz>
для популяризации платформы и вообще
<Qrntzz>
хм
<Qrntzz>
мне сразу в голову приходят парсеры/лексеры окамла
<Kakadu>
camlp4?
<Kakadu>
extended grammars for Qt UI?
<Qrntzz>
да тут много альтернатив -- camlp4, ocamllex/ocamlyacc, menhir, etc
<Kakadu>
I don't think we should start from this)
<Qrntzz>
:-)
<Kakadu>
)
<Kakadu>
so what?
<Kakadu>
RIP? :D
fridim_ has joined #ocaml
<Qrntzz>
lol
<Qrntzz>
I prefer the term "suspended animation"
<Qrntzz>
until someone figures out how to do it properly
<orbitz>
Cat dead, details later
<Kakadu>
have you some time to formulate this problem in a wiki?
<Qrntzz>
yes, won't you mind if I'll do this right after I have some food
metasyntax|work has quit [Quit: WeeChat [quit]]
fridim_ has quit [Ping timeout: 240 seconds]
Kakadu has quit [Quit: Konversation terminated!]
Kakadu has joined #ocaml
raichoo has quit [Ping timeout: 240 seconds]
raichoo has joined #ocaml
_andre has quit [Quit: leaving]
<_habnabit>
oh, oasis can't deal with ocamlmakefile?
<bobry>
_habnabit: afaik no, why don't you switch to oasis completely instead? :)
<_habnabit>
not my project
<_habnabit>
I'm just trying to distribute it in a way that's oasis-compatible, and I was hoping I wouldn't have to redo the whole thing
<orbitz>
this is embarrasing, but does anyone see the syntax error on the Gc.set line? I copied this code from another source file: https://gist.github.com/0a7cd8621d09ccd5f003
<_habnabit>
orbitz, IIRC you can't have an expression in the x part of {x with ...}
<orbitz>
Weird, I'm doing this in another peice of code and it compiles fine...
<orbitz>
that fixed it though
<orbitz>
what is going on with my other code though...
<Drakken>
level "." bypasses function application.
<hcarty>
_habnabit: You can wrap oasis around existing build systems. See Batteries as one example.
<hcarty>
_habnabit: But it looks like you figured out something already... I missed that last comment.
fridim_ has joined #ocaml
<_habnabit>
hcarty, yeah, it was simple enough that I could rewrite it to use ocamlbuild trivially
ulfdoz has quit [Ping timeout: 248 seconds]
<_habnabit>
I just uploaded ocaml-glpk to oasis-db, if that needs any further processing
<_habnabit>
... hmm, when installing it with odb, something is trying to run oasis setup-dev
<_habnabit>
it's never done that before. does that just mean I'm missing some file in the tarball?
<hcarty>
_habnabit: Did you run "oasis setup" or "oasis setup-dev" when you setup oasis for the package?
<_habnabit>
I think it was setup-dev
<_habnabit>
do I need to run `oasis setup` for distribution?
<thelema>
_habnabit: yes, setup-dev re-runs oasis every build
<_habnabit>
ah
<_habnabit>
well, I guess I need to upload a new tarball then
<thelema>
make sure to bump the version - oasis-db is picky about that
<_habnabit>
is there an oasis command to make a tarball?
<thelema>
not that I know of.
<_habnabit>
dang
<thelema>
I just tar -zcvf foo-ver.tar.gz foo-ver/
<thelema>
I just found out that cabal can make tarball packages; I'm happy that gildor hasn't reached that far with oasis yet
<_habnabit>
there, uploaded
Kakadu has quit [Quit: Konversation terminated!]
avsm has joined #ocaml
<thelema>
You can test a directory to see if odb can install it without uploading to oasis-db by putting "foo dir=/home/user/foo" into the odb packages file
<_habnabit>
ah
<thelema>
This has just recently (last week) been added, and it seems to work reasonably
<thelema>
I'm tempted to allow URLs and directories on the command line to shortcut this procedure further
ocp has quit [Ping timeout: 244 seconds]
<_habnabit>
is there a way to pass extra flags in via environment variables? I'm trying to do the equivalent of CFLAGS="-I/path/to/somewhere"
<_habnabit>
(doing that had no effect)
agolsme has quit [Quit: Lost terminal]
<_habnabit>
never mind I found C_INCLUDE_PATH
<_habnabit>
keep forgetting about that one
edwin has quit [Remote host closed the connection]
lopex has quit [Read error: Connection reset by peer]
bobry has quit [Remote host closed the connection]
joewilliams has quit [Remote host closed the connection]
emmanuelux has quit [Remote host closed the connection]
sebz has joined #ocaml
avsm has quit [Quit: Leaving.]
destrius has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
<NaCl>
In batteries, am I supposed to open BatString as String?
<thelema>
NaCl: no, just 'open Batteries'
<_habnabit>
or just `open Batteries`
<NaCl>
kk
<thelema>
NaCl: if you open BatString as String, you'll lose the functions not provided by batteries (although this is changing in dev batteries). 'open batteries' will continue to work